diff options
| author | Yannick Tivisse <yti@odoo.com> | 2018-03-14 15:11:02 +0100 |
|---|---|---|
| committer | Yannick Tivisse <yti@odoo.com> | 2018-03-14 16:09:57 +0100 |
| commit | 16631338739c5cea1f7bc7abaea8c9a0f6f0790b (patch) | |
| tree | e91f69043d1d1a1fc907acb099cb32450a54bf24 | |
| parent | f1608829a17639fe03ef495aa627a557d0138108 (diff) | |
[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
| -rw-r--r-- | addons/purchase/purchase.py | 3 |
1 files changed, 2 insertions, 1 deletions
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) |
