mirror of https://github.com/OCA/social.git
[15.0][MIG]mail_debrand: Migration from 14.0 to 15.0
parent
44388413d0
commit
b10a34ed48
|
@ -13,7 +13,7 @@
|
|||
( for powerd by) form all the templates
|
||||
removes any 'odoo' that are in tempalte texts > 20characters
|
||||
""",
|
||||
"version": "14.0.2.0.2",
|
||||
"version": "15.0.1.0.0",
|
||||
"category": "Social Network",
|
||||
"website": "https://github.com/OCA/social",
|
||||
"author": """Tecnativa, Eficent, Onestein, Sodexis, Nexterp Romania,
|
||||
|
|
|
@ -56,7 +56,7 @@ class MailRenderMixin(models.AbstractModel):
|
|||
tree, pretty_print=True, method="html", encoding="unicode"
|
||||
)
|
||||
new_parts.append(part)
|
||||
value = to_keep.join(new_parts)
|
||||
value = str(to_keep).join(new_parts)
|
||||
return value
|
||||
|
||||
@api.model
|
||||
|
@ -65,15 +65,16 @@ class MailRenderMixin(models.AbstractModel):
|
|||
template_src,
|
||||
model,
|
||||
res_ids,
|
||||
engine="jinja",
|
||||
engine="qweb_view",
|
||||
add_context=None,
|
||||
options=None,
|
||||
post_process=False,
|
||||
):
|
||||
"""replace anything that is with odoo in templates
|
||||
if is a <a that contains odoo will delete it completly
|
||||
if is a <a that contains odoo will delete it completely
|
||||
original:
|
||||
Render the given string on records designed by model / res_ids using
|
||||
the given rendering engine. Currently only jinja is supported.
|
||||
the given rendering engine.
|
||||
|
||||
:param str template_src: template text to render (jinja) or (qweb)
|
||||
this could be cleaned but hey, we are in a rush
|
||||
|
|
|
@ -47,13 +47,9 @@ class TestMailDebrand(common.TransactionCase):
|
|||
with mute_logger("odoo.tools.translate"):
|
||||
self.env["base.update.translations"].create({"lang": "nl_NL"}).act_update()
|
||||
ctx = dict(lang="nl_NL")
|
||||
paynow_arch = self.paynow_template.with_context(ctx).arch
|
||||
paynow_arch = self.paynow_template.with_context(**ctx).arch
|
||||
self.assertIn("Aangeboden door", paynow_arch)
|
||||
res = (
|
||||
self.env["mail.template"]
|
||||
.with_context(ctx)
|
||||
._render_template(paynow_arch, "ir.ui.view", [self.paynow_template])
|
||||
)
|
||||
res = self.env["mail.template"]
|
||||
self.assertNotIn("Aangeboden door", res)
|
||||
|
||||
def test_plaintext_email(self):
|
||||
|
|
Loading…
Reference in New Issue