[IMP][MOV] website_(portal_)sale: move access button from ecommerce to website_portal_sale

website_portal_sale adds support for sale orders in the front-end. It is therefore
in that module that we have to set the buttons in notification emails. Not in
ecommerce app.
This commit is contained in:
Thibault Delavallée
2016-09-23 10:01:42 +02:00
parent 458aaca328
commit e8cb5c6e0f
2 changed files with 11 additions and 9 deletions
@@ -30,6 +30,17 @@ class SaleOrder(models.Model):
}
return super(SaleOrder, self).get_access_action()
@api.multi
def _notification_recipients(self, message, groups):
groups = super(SaleOrder, self)._notification_recipients(message, groups)
self.ensure_one()
if self.state not in ('draft', 'cancel'):
for group_name, group_method, group_data in groups:
group_data['has_button_access'] = True
return groups
def _force_lines_to_invoice_policy_order(self):
for line in self.order_line:
if self.state in ['sale', 'done']:
-9
View File
@@ -160,15 +160,6 @@ class SaleOrder(models.Model):
accessory_products -= order.website_order_line.mapped('product_id')
return random.sample(accessory_products, len(accessory_products))
@api.multi
def _notification_recipients(self, message, groups):
groups = super(SaleOrder, self)._notification_recipients(message, groups)
for group_name, group_method, group_data in groups:
group_data['has_button_access'] = True
return groups
class Website(models.Model):
_inherit = 'website'