Skip to content

Commit

Permalink
[IMP] sale: email notification button for all users
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
tivisse committed Mar 7, 2016
1 parent d28cde3 commit 38f0e1f
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions addons/sale/sale.py
Original file line number Diff line number Diff line change
Expand Up @@ -423,6 +423,18 @@ def _create_analytic_account(self, prefix=None):
})
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'
Expand Down

0 comments on commit 38f0e1f

Please sign in to comment.