Merge lp:~yann-papouin/openobject-addons/6.1-bug-1188629-price-surchage-uom into lp:openobject-addons/6.1

Proposed by Yann Papouin
Status: Needs review
Proposed branch: lp:~yann-papouin/openobject-addons/6.1-bug-1188629-price-surchage-uom
Merge into: lp:openobject-addons/6.1
Diff against target: 22 lines (+8/-1)
1 file modified
product/pricelist.py (+8/-1)
To merge this branch: bzr merge lp:~yann-papouin/openobject-addons/6.1-bug-1188629-price-surchage-uom
Reviewer Review Type Date Requested Status
OpenERP Core Team Pending
Review via email: mp+184737@code.launchpad.net

Description of the change

price_surcharge computed with product uom

To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'product/pricelist.py'
2--- product/pricelist.py 2012-01-31 13:36:57 +0000
3+++ product/pricelist.py 2013-09-10 08:48:16 +0000
4@@ -269,10 +269,17 @@
5 price_type.field, context=context)[product_id], round=False, context=context)
6
7 if price is not False:
8+ surcharge = res['price_surcharge'] or 0.0
9+ if 'uom' in context:
10+ product = products_dict[product_id]
11+ uom = product.uos_id or product.uom_id
12+ surcharge = product_uom_obj._compute_price(cr, uid, uom.id, surcharge, context['uom'])
13+
14 price_limit = price
15 price = price * (1.0+(res['price_discount'] or 0.0))
16 price = rounding(price, res['price_round']) #TOFIX: rounding with tools.float_rouding
17- price += (res['price_surcharge'] or 0.0)
18+ price += surcharge
19+
20 if res['price_min_margin']:
21 price = max(price, price_limit+res['price_min_margin'])
22 if res['price_max_margin']: