From 0c1d73b1bec68f0417856497ae125e069544b965 Mon Sep 17 00:00:00 2001 From: Denis Ledoux Date: Mon, 2 Feb 2015 16:07:41 +0100 Subject: [PATCH] [FIX] sale: missing context in browse call. Not passing the context should be exceptional, in almost all cases you should pass it. In this specific case, not passing it will, for instance, prevent the use of the key 'active_test' in the context, and there is therefore no way to count all variants, including disabled ones. --- addons/product/product.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/product/product.py b/addons/product/product.py index 07a42e2408e..a0a6d8f48e0 100644 --- a/addons/product/product.py +++ b/addons/product/product.py @@ -489,7 +489,7 @@ class product_template(osv.osv): def _get_product_variant_count(self, cr, uid, ids, name, arg, context=None): res = {} - for product in self.browse(cr, uid, ids): + for product in self.browse(cr, uid, ids, context=context): res[product.id] = len(product.product_variant_ids) return res