summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorstephanchrst <stephanchrst@gmail.com>2022-12-15 15:33:48 +0700
committerstephanchrst <stephanchrst@gmail.com>2022-12-15 15:33:48 +0700
commit7fb1392eee35b8620ef14a27640fe967be544a2d (patch)
treed2b4fd2715190f2086e9877cced6d0a67fe4f009
parentb89dd5fcb93b54802e6d18e182aec3ab2a554eeb (diff)
retry send mail
-rw-r--r--indoteknik_custom/models/mail_mail.py12
1 files changed, 12 insertions, 0 deletions
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'