diff options
Diffstat (limited to 'addons/mail/models/mail_thread.py')
| -rw-r--r-- | addons/mail/models/mail_thread.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/addons/mail/models/mail_thread.py b/addons/mail/models/mail_thread.py index 802fef140ae..caff059b408 100644 --- a/addons/mail/models/mail_thread.py +++ b/addons/mail/models/mail_thread.py @@ -2307,12 +2307,13 @@ class MailThread(models.AbstractModel): email_ids = emails.ids dbname = self.env.cr.dbname _context = self._context + + @self.env.cr.postcommit.add def send_notifications(): db_registry = registry(dbname) with api.Environment.manage(), db_registry.cursor() as cr: env = api.Environment(cr, SUPERUSER_ID, _context) env['mail.mail'].browse(email_ids).send() - self._cr.after('commit', send_notifications) else: emails.send() |
