From c86201c5532f7338c0fd8a7663ed608a650c4ca5 Mon Sep 17 00:00:00 2001 From: Denis Ledoux Date: Thu, 8 Sep 2016 15:58:42 +0200 Subject: [PATCH] [FIX] mrp: fix BOM smart button for product variants Do not force the `search_default_product_id`to the current product variant, as the domain just above could return a result, a BOM which is set for the template of this variant but not for the variant istself, that this filter would hide. This is following the revision 52cba1b56325f101ef159648d5d1dd3b974576f0 Because of this, a product variant smart button could display "1 BOM", but when clicking on it, none would be displayed, which is not user-friendly at all. opw-687912 --- addons/mrp/product.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/mrp/product.py b/addons/mrp/product.py index 0c461ae8421..3e2487eacce 100644 --- a/addons/mrp/product.py +++ b/addons/mrp/product.py @@ -92,6 +92,6 @@ class product_product(osv.osv): ('product_id', '=', False), ('product_tmpl_id', 'in', list(products)), ] - result['context'] = "{'default_product_id': active_id, 'search_default_product_id': active_id, 'default_product_tmpl_id': %s}" % (len(products) and products.pop() or 'False') + result['context'] = "{'default_product_id': active_id, 'default_product_tmpl_id': %s}" % (len(products) and products.pop() or 'False') result['domain'] = str(domain) return result