From 0f8cc6e20800d513c524c5f85344bfe8203720d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment?= Date: Fri, 6 Sep 2024 09:44:34 +0200 Subject: [PATCH] fix: solve usererror when sending birthday gift com --- partner_communication/wizards/mail_compose_message.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/partner_communication/wizards/mail_compose_message.py b/partner_communication/wizards/mail_compose_message.py index f867f69ef..12d5669b0 100644 --- a/partner_communication/wizards/mail_compose_message.py +++ b/partner_communication/wizards/mail_compose_message.py @@ -77,8 +77,12 @@ def _get_mail_values(self, template, res_ids): write_data = wizard.onchange_template_id( template.id, "mass_mail", False, False )["value"] - values = wizard.get_mail_values(res_ids) + + # Body would be sanitized if we write it now, breaking any embedded code and + # causing an error. + # Only usage is create_emails above and it overrides it just after. + del write_data["body"] wizard.write(write_data) - return values + return wizard.get_mail_values(res_ids)