From 16631338739c5cea1f7bc7abaea8c9a0f6f0790b Mon Sep 17 00:00:00 2001 From: Yannick Tivisse Date: Wed, 14 Mar 2018 15:11:02 +0100 Subject: [PATCH] [FIX] purchase: Don't auto subscribe recipients on mail composers Purpose ======= During the refactoring of the purchase module something went wrong when overriding the 'send_mail' method. The 'mail_post_autofollow' key should have been set into the context only for the purchase orders model. See: https://github.com/odoo/odoo/commit/cb01be2#diff-fe8587929089e5fdb6c75687011b1c7eR822 --- addons/purchase/purchase.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/addons/purchase/purchase.py b/addons/purchase/purchase.py index b051377410b..be396e28b8c 100644 --- a/addons/purchase/purchase.py +++ b/addons/purchase/purchase.py @@ -1047,7 +1047,8 @@ class MailComposeMessage(models.Model): @api.multi def send_mail(self, auto_commit=False): if self._context.get('default_model') == 'purchase.order' and self._context.get('default_res_id'): + self = self.with_context(mail_post_autofollow=True) order = self.env['purchase.order'].browse([self._context['default_res_id']]) if order.state == 'draft': order.state = 'sent' - return super(MailComposeMessage, self.with_context(mail_post_autofollow=True)).send_mail(auto_commit=auto_commit) + return super(MailComposeMessage, self).send_mail(auto_commit=auto_commit)