From fbca7320b71233081cd8428fa56bba185cf2c9a4 Mon Sep 17 00:00:00 2001 From: david Date: Wed, 4 Mar 2020 11:41:55 +0100 Subject: [PATCH] [FIX] mail_debrand: template with original terms Depending of the context the term could come translated or in the original term. We should consider both. Also notice that if the translated term in this module differs from the one in the template it won't be catched. --- mail_debrand/models/mail_template.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/mail_debrand/models/mail_template.py b/mail_debrand/models/mail_template.py index 974a4180b..2fdc79a45 100644 --- a/mail_debrand/models/mail_template.py +++ b/mail_debrand/models/mail_template.py @@ -21,7 +21,11 @@ class MailTemplate(models.Model): @api.model def _debrand_body(self, body): - using_word = _('using') + """Depending of the context the term could come translated or in + the original term. We should consider both. Also notice that if + the translated term in this module differs from the one in the + template it won't be catched.""" + using_word = "(using|{})".format(_('using')) odoo_word = _('Odoo') return re.sub( using_word + "(.*)[\r\n]*(.*)>" + odoo_word + r"", "", body,