[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) <tde@openerp.com>
This commit is contained in:
nounoubensebia
2021-05-11 10:39:42 +00:00
parent 90ddddbb87
commit d4030ebd1a
2 changed files with 6 additions and 0 deletions
+3
View File
@@ -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'})
+3
View File
@@ -67,6 +67,9 @@
<field name="model">mail.mail</field>
<field name="arch" type="xml">
<tree string="Emails" decoration-muted="state in ('sent', 'cancel')" decoration-info="state=='outgoing'" decoration-danger="state=='exception'">
<header>
<button name="action_retry" string="Retry" type="object"/>
</header>
<field name="date"/>
<field name="subject"/>
<field name="author_id" string="User"/>