[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
This commit is contained in:
Denis Ledoux 2014-11-04 11:54:03 +01:00
parent 18b7b28bc1
commit 5035c76f42
1 changed files with 2 additions and 1 deletions

View File

@ -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)) + \