Skip to content
Snippets Groups Projects
Commit cb6146c0 authored by Victor Feyens's avatar Victor Feyens Committed by fw-bot
Browse files

[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#38427

X-original-commit: c8ad6147
Signed-off-by: default avatarVictor Feyens (vfe) <vfe@odoo.com>
parent 6ccf3b61
Branches
Tags
No related merge requests found
......@@ -510,9 +510,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:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment