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
=== modified file 'product/pricelist.py'
--- product/pricelist.py 2012-01-31 13:36:57 +0000
+++ product/pricelist.py 2013-09-10 08:48:16 +0000
@@ -269,10 +269,17 @@
269 price_type.field, context=context)[product_id], round=False, context=context)269 price_type.field, context=context)[product_id], round=False, context=context)
270270
271 if price is not False:271 if price is not False:
272 surcharge = res['price_surcharge'] or 0.0
273 if 'uom' in context:
274 product = products_dict[product_id]
275 uom = product.uos_id or product.uom_id
276 surcharge = product_uom_obj._compute_price(cr, uid, uom.id, surcharge, context['uom'])
277
272 price_limit = price278 price_limit = price
273 price = price * (1.0+(res['price_discount'] or 0.0))279 price = price * (1.0+(res['price_discount'] or 0.0))
274 price = rounding(price, res['price_round']) #TOFIX: rounding with tools.float_rouding280 price = rounding(price, res['price_round']) #TOFIX: rounding with tools.float_rouding
275 price += (res['price_surcharge'] or 0.0)281 price += surcharge
282
276 if res['price_min_margin']:283 if res['price_min_margin']:
277 price = max(price, price_limit+res['price_min_margin'])284 price = max(price, price_limit+res['price_min_margin'])
278 if res['price_max_margin']:285 if res['price_max_margin']: