From 75f2d8444e8f4b31fec96f2ddea7fc91220d3cc9 Mon Sep 17 00:00:00 2001 From: Victor Feyens Date: Wed, 9 Oct 2019 14:41:25 +0000 Subject: [PATCH] [FIX] mail: fix mailing wizard when partners and template specified if partner_ids and template_id are set, a traceback happens. Indeed, some mail fields are not taken from the res_ids when partner_ids is set. When trying to update the values with the one from the template, the existing values are popped, which raised an error as those keys weren't set. closes odoo/odoo#38434 X-original-commit: c8ad614718674b55e9af5edd062ded958136e7ac Signed-off-by: Victor Feyens (vfe) --- addons/mail/wizard/mail_compose_message.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/addons/mail/wizard/mail_compose_message.py b/addons/mail/wizard/mail_compose_message.py index b8b516f878c..c1d7a1edcc7 100644 --- a/addons/mail/wizard/mail_compose_message.py +++ b/addons/mail/wizard/mail_compose_message.py @@ -508,9 +508,9 @@ class MailComposer(models.TransientModel): for res_id in res_ids: if template_values.get(res_id): # recipients are managed by the template - results[res_id].pop('partner_ids') - results[res_id].pop('email_to') - results[res_id].pop('email_cc') + results[res_id].pop('partner_ids', None) + results[res_id].pop('email_to', None) + results[res_id].pop('email_cc', None) # remove attachments from template values as they should not be rendered template_values[res_id].pop('attachment_ids', None) else: