From 3598538b571d1266699985ecf195c88b6f2925f7 Mon Sep 17 00:00:00 2001 From: Denis Ledoux Date: Mon, 20 Feb 2017 16:26:44 +0100 Subject: [PATCH] [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 --- addons/sale/sale.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/sale/sale.py b/addons/sale/sale.py index 7d9f52df6b7..35db9cec6e6 100644 --- a/addons/sale/sale.py +++ b/addons/sale/sale.py @@ -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,