[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:
Denis Ledoux
2017-02-20 16:29:07 +01:00
parent 32e0f0954f
commit 3598538b57
+1 -1
View File
@@ -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,