From 38f0e1f122bfeebbbc93e1235de2538cf310e19f Mon Sep 17 00:00:00 2001 From: Yannick Tivisse Date: Wed, 17 Feb 2016 10:23:20 +0100 Subject: [PATCH] [IMP] sale: email notification button for all users The access/follow/actions buttons on the notification email template are sent only to employee. For this particular business model when want all the users to receive them, as the portal users. --- addons/sale/sale.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/addons/sale/sale.py b/addons/sale/sale.py index 98d4d210b18..4a740280109 100644 --- a/addons/sale/sale.py +++ b/addons/sale/sale.py @@ -423,6 +423,18 @@ class SaleOrder(models.Model): }) order.project_id = analytic + @api.multi + def _notification_group_recipients(self, message, recipients, done_ids, group_data): + group_user = self.env.ref('base.group_user') + for recipient in recipients: + if recipient.id in done_ids: + continue + if not recipient.user_ids: + group_data['partner'] |= recipient + else: + group_data['user'] |= recipient + done_ids.add(recipient.id) + return super(SaleOrder, self)._notification_group_recipients(message, recipients, done_ids, group_data) class SaleOrderLine(models.Model): _name = 'sale.order.line'