[FIX] sale: Hit the Sales button of an archived product
Without passing `active_test=False` in the context, a one2many fields exludes the record with `active` set to False. For an archived product template, this means `product_variant_ids` returned an empty array opw-708828
This commit is contained in:
+1
-1
@@ -901,7 +901,7 @@ class ProductTemplate(models.Model):
|
||||
def action_view_sales(self):
|
||||
self.ensure_one()
|
||||
action = self.env.ref('sale.action_product_sale_list')
|
||||
product_ids = self.product_variant_ids.ids
|
||||
product_ids = self.with_context(active_test=False).product_variant_ids.ids
|
||||
|
||||
return {
|
||||
'name': action.name,
|
||||
|
||||
Reference in New Issue
Block a user