[FIX] mail: restore send after commit behavior for notification emails

Previously to commit [1] notification emails were send using the after commit
hook (see [2] for related code move and [3] for original code). That commit
changed the parameter default value without any reason, meaning this mechanism
is not used anymore. This commit fixes that behavior.

[1] See commit 581a74143e: code cleaning
[2] See commit 7a6269719f: code move
[3] See commit 38e181ee2c: use of post-commit hook in mail

closes odoo/odoo#34645

Signed-off-by: Xavier Dollé (xdo) <xdo@odoo.com>
This commit is contained in:
Thibault Delavallée
2019-07-08 10:00:02 +00:00
parent e6c23a45de
commit 1f5e89b176
+1 -1
View File
@@ -2029,7 +2029,7 @@ class MailThread(models.AbstractModel):
self.env['bus.bus'].sudo().sendmany(notifications)
return True
def _notify_record_by_email(self, message, partners_data, msg_vals=False, model_description=False, mail_auto_delete=True, send_after_commit=False):
def _notify_record_by_email(self, message, partners_data, msg_vals=False, model_description=False, mail_auto_delete=True, send_after_commit=True):
""" Method to send email linked to notified messages.
:param message: mail.message record to notify;
:param partners_data: partner to notify by email coming from _notify_compute_recipients