From d4030ebd1ad0a45f21893ee14caa44141bc506f4 Mon Sep 17 00:00:00 2001 From: nounoubensebia Date: Mon, 26 Apr 2021 16:03:34 +0000 Subject: [PATCH] [IMP] mail: add retry button for multiple records Add a retry button to enable the user to try and resend multiple emails at once, purpose is to allow users to easily send back multiple emails which crashed for a "one-shot" reason instead of asking them to resubmit them one by one. Task-2492990 closes odoo/odoo#69880 Signed-off-by: Thibault Delavallee (tde) --- addons/mail/models/mail_mail.py | 3 +++ addons/mail/views/mail_mail_views.xml | 3 +++ 2 files changed, 6 insertions(+) diff --git a/addons/mail/models/mail_mail.py b/addons/mail/models/mail_mail.py index 0fd8bee4161..13b0ce3308b 100644 --- a/addons/mail/models/mail_mail.py +++ b/addons/mail/models/mail_mail.py @@ -100,6 +100,9 @@ class MailMail(models.Model): self = self.with_context(dict(self._context, default_type=None)) return super(MailMail, self).default_get(fields) + def action_retry(self): + self.filtered(lambda mail: mail.state == 'exception').mark_outgoing() + def mark_outgoing(self): return self.write({'state': 'outgoing'}) diff --git a/addons/mail/views/mail_mail_views.xml b/addons/mail/views/mail_mail_views.xml index 1eef28a6253..420d5522d06 100644 --- a/addons/mail/views/mail_mail_views.xml +++ b/addons/mail/views/mail_mail_views.xml @@ -67,6 +67,9 @@ mail.mail +
+