openerp-community-reviewer team mailing list archive
-
openerp-community-reviewer team
-
Mailing list archive
-
Message #00288
[Merge] lp:~yann-papouin/ocb-addons/6.1-bug-1188629-price-surchage-uom into lp:ocb-addons/6.1
Yann Papouin has proposed merging lp:~yann-papouin/ocb-addons/6.1-bug-1188629-price-surchage-uom into lp:ocb-addons/6.1.
Requested reviews:
OpenERP Community Backports Team (ocb)
Related bugs:
Bug #1188629 in OpenERP Community Backports (Addons): "[6.1][7.0][trunk] price_surcharge must be affiliated with product uom"
https://bugs.launchpad.net/ocb-addons/+bug/1188629
For more details, see:
https://code.launchpad.net/~yann-papouin/ocb-addons/6.1-bug-1188629-price-surchage-uom/+merge/189106
Automatically derived from https://code.launchpad.net/~yann-papouin/openobject-addons/6.1-bug-1188629-price-surchage-uom for https://code.launchpad.net/~openerp/openobject-addons/6.1. Below is a copy of the original description.
price_surcharge computed with product uom
--
https://code.launchpad.net/~yann-papouin/ocb-addons/6.1-bug-1188629-price-surchage-uom/+merge/189106
Your team OpenERP Community Backports Team is requested to review the proposed merge of lp:~yann-papouin/ocb-addons/6.1-bug-1188629-price-surchage-uom into lp:ocb-addons/6.1.
=== modified file 'product/pricelist.py'
--- product/pricelist.py 2012-01-31 13:36:57 +0000
+++ product/pricelist.py 2013-10-03 15:06:13 +0000
@@ -269,10 +269,17 @@
price_type.field, context=context)[product_id], round=False, context=context)
if price is not False:
+ surcharge = res['price_surcharge'] or 0.0
+ if '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))
price = rounding(price, res['price_round']) #TOFIX: rounding with tools.float_rouding
- 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']:
Follow ups