From 3c45f08825b1a0de35f2027f7cb53977f2c11f08 Mon Sep 17 00:00:00 2001 From: Fanny He Date: Wed, 12 Jun 2019 15:13:36 +0000 Subject: [PATCH] [FIX] mail: Remove failure_type and failure_reason when mail successfully sent When sending a message (e.g. in a CRM lead or SO), a failure_type and failure_reason are displayed, even when the message is successfully sent. This is because these fields are not updated when the email_status is changed to "sent". We reset these fields to '' when the message is sent. OPW-2003290 closes odoo/odoo#34082 Signed-off-by: Nans Lefebvre (len) --- 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 a2ba820656f..5875ab42ee2 100644 --- a/addons/mail/models/mail_mail.py +++ b/addons/mail/models/mail_mail.py @@ -172,6 +172,8 @@ class MailMail(models.Model): messages._notify_failure_update() # notify user that we have a failure (notifications - failed).sudo().write({ 'email_status': 'sent', + 'failure_type': '', + 'failure_reason': '', }) if not failure_type or failure_type == 'RECIPIENT': # if we have another error, we want to keep the mail. mail_to_delete_ids = [mail.id for mail in self if mail.auto_delete]