summaryrefslogtreecommitdiff
path: root/addons/mass_mailing/wizard
diff options
context:
space:
mode:
authorThibault Delavallée <tde@odoo.com>2020-11-13 10:07:08 +0000
committerThibault Delavallée <tde@odoo.com>2021-04-19 14:11:14 +0000
commitcf183da67ff47636bbba967609b1e106bd97c404 (patch)
tree7c255e8ff2529967c52d5cb9f0d33facbe22c8bd /addons/mass_mailing/wizard
parente77b9e575e398f42df524bdaf5d692ea882a4521 (diff)
[FIX] mass_mailing: keep invalid email on failed traces
SPECIFICATIONS Traces are sent to normalized emails. If email is invalid email set on traces is void as we cannot normalize it. In this commit we set it to the original value of email, allowing to debug or at least understand what was wrong. It also makes behavior coherent with SMS Marketing. LINKS Task ID-2508643 Prepares Task ID-27033 (support QWeb in templates) Prepares Task ID-2377974 (clean trace and status management in mass mailing) COM PR odoo/odoo#69461 ENT PR odoo/enterprise#17780
Diffstat (limited to 'addons/mass_mailing/wizard')
-rw-r--r--addons/mass_mailing/wizard/mail_compose_message.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/addons/mass_mailing/wizard/mail_compose_message.py b/addons/mass_mailing/wizard/mail_compose_message.py
index 726410ef6af..8ba5c783a74 100644
--- a/addons/mass_mailing/wizard/mail_compose_message.py
+++ b/addons/mass_mailing/wizard/mail_compose_message.py
@@ -74,7 +74,8 @@ class MailComposeMessage(models.TransientModel):
'model': self.model,
'res_id': res_id,
'mass_mailing_id': mass_mailing.id,
- 'email': mail_to,
+ # if mail_to is void, keep falsy values to allow searching / debugging traces
+ 'email': mail_to or mail_values.get('email_to'),
}
if mail_values.get('body_html') and mass_mail_layout:
mail_values['body_html'] = mass_mail_layout._render({'body': mail_values['body_html']}, engine='ir.qweb', minimal_qcontext=True)