[FIX] product: redo forward port 2832d2d for fix 12eb157 lost with 43977de

This commit is contained in:
Denis Ledoux 2014-10-14 11:59:57 +02:00
parent 43abcb02ba
commit b447d7b063
1 changed files with 7 additions and 1 deletions

View File

@ -584,7 +584,13 @@ class product_template(osv.osv):
res = {}
product_uom_obj = self.pool.get('product.uom')
for product in products:
res[product.id] = product[ptype] or 0.0
# standard_price field can only be seen by users in base.group_user
# Thus, in order to compute the sale price from the cost price for users not in this group
# We fetch the standard price as the superuser
if ptype != 'standard_price':
res[product.id] = product[ptype] or 0.0
else:
res[product.id] = self.read(cr, SUPERUSER_ID, product.id, [ptype], context=context)[ptype] or 0.0
if ptype == 'list_price':
res[product.id] += product._name == "product.product" and product.price_extra or 0.0
if 'uom' in context: