From 5035c76f42bc2999c24e4943ee27f96ee426d47c Mon Sep 17 00:00:00 2001 From: Denis Ledoux Date: Tue, 4 Nov 2014 11:54:03 +0100 Subject: [PATCH] [FIX] product: product prices can be company dependent Some prices, as standard_price, being a property, are company dependent. Therefore, when browsing as superuser, force_company is mandatory to get the property of the user company --- addons/product/product.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/addons/product/product.py b/addons/product/product.py index ac0de1d2fec..b70fa030dd0 100644 --- a/addons/product/product.py +++ b/addons/product/product.py @@ -719,7 +719,8 @@ class product_product(osv.osv): res = {} product_uom_obj = self.pool.get('product.uom') - for product in self.browse(cr, SUPERUSER_ID, ids, context=context): + company_id = self.pool['res.users'].read(cr, uid, uid, ['company_id'], context=context)['company_id'][0] + for product in self.browse(cr, SUPERUSER_ID, ids, context=dict(context, force_company=company_id)): res[product.id] = product[ptype] or 0.0 if ptype == 'list_price': res[product.id] = (res[product.id] * (product.price_margin or 1.0)) + \