[FIX] sale: fix context update wrongly migrated / updated at 94716a3f14

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.
This commit is contained in:
Thibault Delavallée
2016-09-30 12:37:02 +02:00
parent b2b85fbb19
commit 00aab045b0
+2 -1
View File
@@ -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):