[FIX] mass_mailing: body editor with translation

Since a324b22d, the mass mailing body editor would:

- save english body in language Y if user had language Y,
- not allow to edit translations in another language

This is due to how html_translate is set as translation function of html
only if the field is set as sanitize==True.

closes #13196
opw-685629
This commit is contained in:
Nicolas Lempereur
2016-08-18 08:31:24 +02:00
parent 037a152db6
commit 06fdc2a6de
+2 -1
View File
@@ -9,6 +9,7 @@ from openerp import SUPERUSER_ID
from openerp.exceptions import UserError
from openerp.tools.misc import DEFAULT_SERVER_DATETIME_FORMAT
from openerp.tools.safe_eval import safe_eval as eval
from openerp.tools.translate import html_translate
from openerp.osv import osv, fields
@@ -478,7 +479,7 @@ class MassMailing(osv.Model):
'create_date': fields.datetime('Creation Date'),
'sent_date': fields.datetime('Sent Date', oldname='date', copy=False),
'schedule_date': fields.datetime('Schedule in the Future'),
'body_html': fields.html('Body', translate=True, sanitize=False),
'body_html': fields.html('Body', translate=html_translate, sanitize=False),
'attachment_ids': fields.many2many(
'ir.attachment', 'mass_mailing_ir_attachments_rel',
'mass_mailing_id', 'attachment_id', 'Attachments'