[FIX] product price was wrong when margin is not set
If margin is not set, it equals False. Multiplting a number by False set this number to 0 bzr revid: olt@tinyerp.com-20090727091020-vd8vmj70yxom3v30
This commit is contained in:
parent
93c70c222c
commit
f2a92b5b56
|
@ -383,7 +383,7 @@ class product_product(osv.osv):
|
|||
uom.id, product.list_price, context['uom'])
|
||||
else:
|
||||
res[product.id] = product.list_price
|
||||
res[product.id] = (res[product.id] or 0.0) * product.price_margin + product.price_extra
|
||||
res[product.id] = (res[product.id] or 0.0) * (product.price_margin or 1.0) + product.price_extra
|
||||
return res
|
||||
|
||||
def _get_partner_code_name(self, cr, uid, ids, product_id, partner_id, context={}):
|
||||
|
@ -518,7 +518,7 @@ class product_product(osv.osv):
|
|||
for product in self.browse(cr, uid, ids, context=context):
|
||||
res[product.id] = product[ptype] or 0.0
|
||||
if ptype == 'list_price':
|
||||
res[product.id] = (res[product.id] * product.price_margin) + \
|
||||
res[product.id] = (res[product.id] * (product.price_margin or 1.0)) + \
|
||||
product.price_extra
|
||||
if 'uom' in context:
|
||||
uom = product.uos_id or product.uom_id
|
||||
|
|
Loading…
Reference in New Issue