Skip to content

Commit d4030eb

Browse files
[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#69880 Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
1 parent 90ddddb commit d4030eb

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

addons/mail/models/mail_mail.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,9 @@ def default_get(self, fields):
100100
self = self.with_context(dict(self._context, default_type=None))
101101
return super(MailMail, self).default_get(fields)
102102

103+
def action_retry(self):
104+
self.filtered(lambda mail: mail.state == 'exception').mark_outgoing()
105+
103106
def mark_outgoing(self):
104107
return self.write({'state': 'outgoing'})
105108

addons/mail/views/mail_mail_views.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,9 @@
6767
<field name="model">mail.mail</field>
6868
<field name="arch" type="xml">
6969
<tree string="Emails" decoration-muted="state in ('sent', 'cancel')" decoration-info="state=='outgoing'" decoration-danger="state=='exception'">
70+
<header>
71+
<button name="action_retry" string="Retry" type="object"/>
72+
</header>
7073
<field name="date"/>
7174
<field name="subject"/>
7275
<field name="author_id" string="User"/>

0 commit comments

Comments
 (0)