From fd3f40ec38cca910dbf3338452386e5212fbc2a7 Mon Sep 17 00:00:00 2001 From: "Nathan Marotte (nama)" Date: Tue, 28 Sep 2021 07:47:20 +0000 Subject: [PATCH] [FIX] mail : traceback on Marketing Automation Mailings test send Issue: When test sending a mail in Marketing Automation Mailings, there is a traceback because we try to set the state of the mail to done, even though there is no done in mail_mail.state Steps to reproduce : 1) Install Marketing Automation 2) Create/select a campaign 3) Access the templates of that campaign 4) Create/select a template 5) Click Test 6) Send Sample Email -> Traceback opw-2568210 closes odoo/odoo#79650 X-original-commit: 954c413149befe847a526b54a1fca4c0dd2b16cd Signed-off-by: Thibault Delavallee (tde) --- addons/mail/models/mail_mail.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/addons/mail/models/mail_mail.py b/addons/mail/models/mail_mail.py index b36ad00001a..a1f9ae64eb7 100644 --- a/addons/mail/models/mail_mail.py +++ b/addons/mail/models/mail_mail.py @@ -34,6 +34,8 @@ class MailMail(models.Model): # To remove when automatic context propagation is removed in web client if self._context.get('default_type') not in type(self).message_type.base_field.selection: self = self.with_context(dict(self._context, default_type=None)) + if self._context.get('default_state') not in type(self).state.base_field.selection: + self = self.with_context(dict(self._context, default_state='outgoing')) return super(MailMail, self).default_get(fields) # content