summaryrefslogtreecommitdiff
path: root/addons/mail/wizard
diff options
context:
space:
mode:
authorThibault Delavallée <tde@openerp.com>2016-08-18 13:55:00 +0200
committerThibault Delavallée <tde@openerp.com>2016-09-01 13:22:59 +0200
commit38e181ee2c858decbf8feb935f59019591506621 (patch)
treed4963cfb747899a19d974ec74a216780c7808594 /addons/mail/wizard
parent029d1baf359eabb7ed531287f3cb2b3b8d586d39 (diff)
[IMP] mail: send email notifications after transaction commit
Using after commit event notifications emails are now send once the current transaction is finished. This allows having issues with emails being sent while the transaction failed sometimes after email sending, but still in the same transaction. A small hook is done to allow invitation emails to be sent directly as some data related to mail.message is unlinked directly in the wizard.
Diffstat (limited to 'addons/mail/wizard')
-rw-r--r--addons/mail/wizard/invite.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/addons/mail/wizard/invite.py b/addons/mail/wizard/invite.py
index 51b765bc95a..1d345af517a 100644
--- a/addons/mail/wizard/invite.py
+++ b/addons/mail/wizard/invite.py
@@ -60,6 +60,6 @@ class Invite(models.TransientModel):
'res_id': wizard.res_id,
'no_auto_thread': True,
})
- new_partners.with_context(auto_delete=True)._notify(message, force_send=True, user_signature=True)
+ new_partners.with_context(auto_delete=True)._notify(message, force_send=True, send_after_commit=False, user_signature=True)
message.unlink()
return {'type': 'ir.actions.act_window_close'}