From 9a56bf5fe46bb198c48a7e6b6547310a3c2c755f Mon Sep 17 00:00:00 2001 From: Yannick Tivisse Date: Wed, 17 Feb 2016 14:20:04 +0100 Subject: [PATCH] [IMP] account: 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/account/models/account_invoice.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/addons/account/models/account_invoice.py b/addons/account/models/account_invoice.py index ff347794f5e..f0d19c9dcd0 100644 --- a/addons/account/models/account_invoice.py +++ b/addons/account/models/account_invoice.py @@ -987,6 +987,18 @@ class AccountInvoice(models.Model): res = map(lambda l: (l[0].name, formatLang(self.env, l[1], currency_obj=currency)), res) return res + @api.multi + def _notification_group_recipients(self, message, recipients, done_ids, group_data): + group_user = self.env.res('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(AccountInvoice, self)._notification_group_recipients(message, recipients, done_ids, group_data) class AccountInvoiceLine(models.Model): _name = "account.invoice.line"