From 7fb1392eee35b8620ef14a27640fe967be544a2d Mon Sep 17 00:00:00 2001 From: stephanchrst Date: Thu, 15 Dec 2022 15:33:48 +0700 Subject: retry send mail --- indoteknik_custom/models/mail_mail.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 indoteknik_custom/models/mail_mail.py diff --git a/indoteknik_custom/models/mail_mail.py b/indoteknik_custom/models/mail_mail.py new file mode 100644 index 00000000..26f8bf5c --- /dev/null +++ b/indoteknik_custom/models/mail_mail.py @@ -0,0 +1,12 @@ +from odoo import fields, models, api, _ + + +class MailMail(models.Model): + _inherit = 'mail.mail' + + def retry_send_mail(self): + mails = self.env['mail.mail'].search([ + ('state', 'in', ['exception', 'cancel']), + ]) + for mail in mails: + mail.state = 'outgoing' -- cgit v1.2.3