From c096d2e30b571d134b7ebb0f40dbc50d73bafbaf Mon Sep 17 00:00:00 2001 From: "yann.papouin@gmail.com" Date: Fri, 14 Mar 2014 14:59:54 +0000 Subject: [PATCH] [MRG] product: use product UOM when computing price surcharge https://launchpad.net/bugs/1188629 --- addons/product/pricelist.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/addons/product/pricelist.py b/addons/product/pricelist.py index d4ed256..f695c64 100644 --- a/addons/product/pricelist.py +++ b/addons/product/pricelist.py @@ -293,11 +293,16 @@ class product_pricelist(osv.osv): price_type.field, context=context)[product_id], round=False, context=context) if price is not False: + surcharge = res['price_surcharge'] or 0.0 + if surcharge and 'uom' in context: + product = products_dict[product_id] + uom = product.uos_id or product.uom_id + surcharge = product_uom_obj._compute_price(cr, uid, uom.id, surcharge, context['uom']) price_limit = price price = price * (1.0+(res['price_discount'] or 0.0)) if res['price_round']: price = tools.float_round(price, precision_rounding=res['price_round']) - price += (res['price_surcharge'] or 0.0) + price += surcharge if res['price_min_margin']: price = max(price, price_limit+res['price_min_margin']) if res['price_max_margin']: -- 1.7.10.4