diff options
| author | XavierDo <xdo@odoo.com> | 2018-04-27 16:50:03 +0200 |
|---|---|---|
| committer | XavierDo <xdo@odoo.com> | 2018-06-07 11:46:28 +0200 |
| commit | 133eeb1bbf52e9a9ee58f83be8e7f0aba3c6d1ad (patch) | |
| tree | cd7c6b0a3c931705158c9af590206130480426f6 /addons/mass_mailing/models | |
| parent | aa7fb8c72317e330bbeb6ce29b4aace8627ef1d7 (diff) | |
[ADD] mail, mass_mailing: allow a user to resend a mail with failures
When a mail is in failure state, a red envelope appears next to the message
in a thread but it was difficult to send the mail again.
This tasks will allow users to send mail again easily, or mark notification
as cancelled if the user want to ignore this failure.
A notification will appear in sender systray while mail are in failure.
Task: #46158
PR: #24628
Diffstat (limited to 'addons/mass_mailing/models')
| -rw-r--r-- | addons/mass_mailing/models/mail_mail.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/addons/mass_mailing/models/mail_mail.py b/addons/mass_mailing/models/mail_mail.py index 2de2b3ec4b1..beb4952da1f 100644 --- a/addons/mass_mailing/models/mail_mail.py +++ b/addons/mass_mailing/models/mail_mail.py @@ -95,11 +95,13 @@ class MailMail(models.Model): return res @api.multi - def _postprocess_sent_message(self, mail_sent=True): + def _postprocess_sent_message(self, failure_type='NONE', **kwargs): + mail_sent = failure_type == 'NONE' # we consider that a recipient error is a failure with mass mailling and show them as failed for mail in self: if mail.mailing_id: if mail_sent is True and mail.statistics_ids: mail.statistics_ids.write({'sent': fields.Datetime.now(), 'exception': False}) elif mail_sent is False and mail.statistics_ids: mail.statistics_ids.write({'exception': fields.Datetime.now()}) - return super(MailMail, self)._postprocess_sent_message(mail_sent=mail_sent) + return super(MailMail, self)._postprocess_sent_message(failure_type=failure_type, **kwargs) +
\ No newline at end of file |
