From 00aab045b0e0b769cea6e0a152a30a33de64e2ca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thibault=20Delavall=C3=A9e?= Date: Fri, 30 Sep 2016 12:06:27 +0200 Subject: [PATCH] [FIX] sale: fix context update wrongly migrated / updated at 94716a3f14d929574c46ef165e4364d12a5903ed Purpose of the code is to automatically add the recipients of quotation emails as followers. It is done using the mail_post_autofollow context key. However current code add the context key in all cases and not just when composing a message on sale order. --- addons/sale/sale.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/addons/sale/sale.py b/addons/sale/sale.py index 0fb533a8254..29b12b5f111 100644 --- a/addons/sale/sale.py +++ b/addons/sale/sale.py @@ -810,7 +810,8 @@ class MailComposeMessage(models.TransientModel): order = self.env['sale.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) + self = self.with_context(mail_post_autofollow=True) + return super(MailComposeMessage, self).send_mail(auto_commit=auto_commit) class AccountInvoice(models.Model):