[FIX]sale: wrong price calculation when changing UoM and pricelist based on other pricelist

lp bug: https://launchpad.net/bugs/742100 fixed

bzr revid: ron@tinyerp.com-20110331112206-5ww6yrqyc3y88yzw
This commit is contained in:
ron@tinyerp.com 2011-03-31 16:52:06 +05:30
parent ab529f999f
commit 53cad5a3bf
2 changed files with 3 additions and 0 deletions

View File

@ -234,6 +234,7 @@ class product_pricelist(osv.osv):
[res['base_pricelist_id']], product_id,
qty, context=context)[res['base_pricelist_id']]
ptype_src = self.browse(cr, uid, res['base_pricelist_id']).currency_id.id
uom_price_already_computed = True
price = currency_obj.compute(cr, uid, ptype_src, res['currency_id'], price_tmp, round=False)
elif res['base'] == -2:
# this section could be improved by moving the queries outside the loop:

View File

@ -1111,6 +1111,8 @@ class sale_order_line(osv.osv):
result['product_uos_qty'] = qty
result['th_weight'] = q * product_obj.weight # Round the quantity up
if not uom:
uom =product_obj.uom_id and product_obj.uom_id.id
if not uom2:
uom2 = product_obj.uom_id
if (product_obj.type=='product') and (product_obj.virtual_available * uom2.factor < qty * product_obj.uom_id.factor) \