From de403dc1ab440b9b08ea7fce189cd157745dfe74 Mon Sep 17 00:00:00 2001 From: Nicolas Lempereur Date: Tue, 20 Jun 2017 10:02:03 +0200 Subject: [PATCH] [FIX] mass_mailing: no multi language edit Creating and editing mass mailing in multiple language is managed with the change 05daa15. But currently the language the mass mailing is sent in, is the language of the "Process Mass Mailing Queue" (root user if not changed) so all the recipients will receive the mail in the root user language has at the time the given batch of mails is sended. So this is different from what someone could expect by it being translatable. In any case the recipients list could be based on a lead, a partner a mass mailing contact or other and a language could not be determinable in stable (a mass mailing contact does not have a language for example). If the system worked, there is also a usability downside in the meaning that someone could duplicate a mail and not check all translation and not be aware that the mail he see is maybe not the mail that will be received (if translations have not all been completed). In stable to have the same behavior in any case and lessen the usability burden of users thinking erroneously the mass mailing may be sent in several languages depending on a not-existing heuristic, this changeset remove the translatability of mass mailing content. This has the following effect: no translation editing appear, the mass mailing is edited and sent in one and the same language, If someone want to send a mass mailing in several language, currently in Odoo it would then require to: duplicate the mass mailing, change the domains of recipients base on choosen heuristic, edit the duplicated mass mailing in the choosen language opw-746445 opw-746776 closes #17718 --- addons/mass_mailing/models/mass_mailing.py | 2 +- addons/web_editor/static/src/js/backend.js | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/addons/mass_mailing/models/mass_mailing.py b/addons/mass_mailing/models/mass_mailing.py index 643696ad467..c59f12da0e6 100644 --- a/addons/mass_mailing/models/mass_mailing.py +++ b/addons/mass_mailing/models/mass_mailing.py @@ -487,7 +487,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), + 'body_html': fields.html('Body'), 'attachment_ids': fields.many2many( 'ir.attachment', 'mass_mailing_ir_attachments_rel', 'mass_mailing_id', 'attachment_id', 'Attachments' diff --git a/addons/web_editor/static/src/js/backend.js b/addons/web_editor/static/src/js/backend.js index e35ebcd6204..94c6e8057c0 100644 --- a/addons/web_editor/static/src/js/backend.js +++ b/addons/web_editor/static/src/js/backend.js @@ -183,6 +183,11 @@ var FieldTextHtml = widget.extend({ template: 'web_editor.FieldTextHtml', willStart: function () { var self = this; + + if (this.field.translate === false) { + this.languages = []; + return $.when(); + } return new Model('res.lang').call("search_read", [[['code', '!=', 'en_US']], ["name", "code"]]).then(function (res) { self.languages = res; });