[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.
pull/507/head
david 2020-03-04 11:41:55 +01:00
parent 0f02162a45
commit fbca7320b7
1 changed files with 5 additions and 1 deletions

View File

@ -21,7 +21,11 @@ class MailTemplate(models.Model):
@api.model @api.model
def _debrand_body(self, body): 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') odoo_word = _('Odoo')
return re.sub( return re.sub(
using_word + "(.*)[\r\n]*(.*)>" + odoo_word + r"</a>", "", body, using_word + "(.*)[\r\n]*(.*)>" + odoo_word + r"</a>", "", body,