From 1f5e89b176080dcf3434eb823a306552d53b261e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thibault=20Delavall=C3=A9e?= Date: Mon, 8 Jul 2019 09:59:59 +0000 Subject: [PATCH] [FIX] mail: restore send after commit behavior for notification emails MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 581a74143e9d215654b1988e2480c6516a3a4887: code cleaning [2] See commit 7a6269719fb8663dd62e6313a04a549283989541: code move [3] See commit 38e181ee2c858decbf8feb935f59019591506621: use of post-commit hook in mail closes odoo/odoo#34645 Signed-off-by: Xavier Dollé (xdo) --- addons/mail/models/mail_thread.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/mail/models/mail_thread.py b/addons/mail/models/mail_thread.py index 2a84d3b4d96..0a3743969f1 100644 --- a/addons/mail/models/mail_thread.py +++ b/addons/mail/models/mail_thread.py @@ -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