[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
52cba1b563

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
This commit is contained in:
Denis Ledoux
2016-09-08 16:01:42 +02:00
parent ddcd2e771b
commit c86201c553
+1 -1
View File
@@ -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