[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:
+2
-1
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user