Skip to content

Commit

Permalink
[MRG] product: use product UOM when computing price surcharge
Browse files Browse the repository at this point in the history
  • Loading branch information
yann-papouin authored and Stefan Rijnhart committed Jul 2, 2014
1 parent 5d795c4 commit c096d2e
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion addons/product/pricelist.py
Original file line number Diff line number Diff line change
Expand Up @@ -293,11 +293,16 @@ def _create_parent_category_list(id, lst):
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']:
Expand Down

0 comments on commit c096d2e

Please sign in to comment.