[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:
@@ -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']:
|
||||
|
||||
@@ -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'
|
||||
|
||||
Reference in New Issue
Block a user