[REV] revert of a partially wrong commit introduced in a previous merge with trunk and detected during the code review
bzr revid: qdp-launchpad@openerp.com-20140505123709-2v2efr7ghzgxgo76
This commit is contained in:
parent
78a7ae966f
commit
693a60058e
|
@ -614,15 +614,10 @@ class product_product(osv.osv):
|
|||
return res
|
||||
|
||||
def _product_lst_price(self, cr, uid, ids, name, arg, context=None):
|
||||
res = dict.fromkeys(ids, 0.0)
|
||||
res = {}
|
||||
product_uom_obj = self.pool.get('product.uom')
|
||||
|
||||
# retrieve pricelist
|
||||
pricelist = None
|
||||
if context.get('pricelist'):
|
||||
pricelist = self.pool['product.pricelist'].browse(cr, uid, context.get('pricelist'), context=context)
|
||||
base_currency = self.pool['res.users'].browse(cr, uid, uid, context=context).company_id.currency_id
|
||||
|
||||
for id in ids:
|
||||
res.setdefault(id, 0.0)
|
||||
for product in self.browse(cr, uid, ids, context=context):
|
||||
if 'uom' in context:
|
||||
uom = product.uos_id or product.uom_id
|
||||
|
@ -630,11 +625,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 or 1.0) + product.price_extra
|
||||
# update the result, according to the eventual pricelist currency
|
||||
if pricelist and pricelist.currency_id:
|
||||
res[product.id] = self.pool['res.currency'].compute(
|
||||
cr, uid, base_currency.id, pricelist.currency_id.id, res[product.id], round=False, context=context)
|
||||
res[product.id] = (res[product.id] or 0.0) * (product.price_margin or 1.0) + product.price_extra
|
||||
return res
|
||||
|
||||
def _save_product_lst_price(self, cr, uid, product_id, field_name, field_value, arg, context=None):
|
||||
|
|
Loading…
Reference in New Issue