From e48767fe6509c9dc5bb3c0907ad36d16c4b5b773 Mon Sep 17 00:00:00 2001 From: Denis Ledoux Date: Mon, 14 May 2018 16:33:55 +0200 Subject: [PATCH] [FIX] mass_mailing: force to not use a template for the rendering If the user configures a default `template_id` for the `mail.compose.message`, this template was used by the mass mailing to render the email, and, among others, it therefore used the `email_to` of this email template, to render the recipients, and it was configured empty or something else than `object.id`, it did not used the `active_ids` passed in the context to the `mail.compose.message` `create` call to compute the correct recipients To reproduce: - In developer mode (?debug) - Open the full mail compose message e.g. in app sales, open a so, hit new message, and hit the button to open the full message composer - Set the template to the quotation template is not there already - In the debug menu of the dialog, View > Set defaults, - Click the radio button to all users, and the default to Use template = ... - Then, try to send a mass mailing. It will fail because it cannot compute the `email_to` values correctly because the `email_to` of the quotation template is empty. opw-1840287 --- addons/mass_mailing/models/mass_mailing.py | 1 + 1 file changed, 1 insertion(+) diff --git a/addons/mass_mailing/models/mass_mailing.py b/addons/mass_mailing/models/mass_mailing.py index 154acd47bd8..340d4c8ccb8 100644 --- a/addons/mass_mailing/models/mass_mailing.py +++ b/addons/mass_mailing/models/mass_mailing.py @@ -785,6 +785,7 @@ class MassMailing(osv.Model): 'mass_mailing_id': mailing.id, 'mailing_list_ids': [(4, l.id) for l in mailing.contact_list_ids], 'no_auto_thread': mailing.reply_to_mode != 'thread', + 'template_id': None, } if mailing.reply_to_mode == 'email': composer_values['reply_to'] = mailing.reply_to