summaryrefslogtreecommitdiff
path: root/addons
diff options
context:
space:
mode:
authorOlivier Dony <odo@openerp.com>2013-11-04 18:32:32 +0100
committerOlivier Dony <odo@openerp.com>2013-11-04 18:32:32 +0100
commit6be89e5f82232dff2d5d57a43ed7bb0d86afecbd (patch)
tree31b7103e0c8a6434dcf4c44afd049019ac8ab277 /addons
parenta6ca3b043fd898cfcb714b3fb4d24b9377e8d00c (diff)
[FIX] stock: no early currency rounding when computing average price
It is a common need to set a higher decimal precision for `Product Price` (i.e. the product cost field) for high volume / low value items. This may typically require up to 4-6 decimals for e.g. EUR/USD-based companies where the currency has 2 decimals. In that case the product cost should be stored with full precision without applying the currency rounding. The appropriate currency rounding will be applied anyway as soon as a transaction actually uses that product cost (typically in a SO/PO) bzr revid: odo@openerp.com-20131104173232-84g115x6ykxoc1rh
Diffstat (limited to 'addons')
-rw-r--r--addons/stock/stock.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/addons/stock/stock.py b/addons/stock/stock.py
index d65689ede43..f3efd8a353e 100644
--- a/addons/stock/stock.py
+++ b/addons/stock/stock.py
@@ -1281,7 +1281,7 @@ class stock_picking(osv.osv):
if qty > 0:
new_price = currency_obj.compute(cr, uid, product_currency,
- move_currency_id, product_price)
+ move_currency_id, product_price, round=False)
new_price = uom_obj._compute_price(cr, uid, product_uom, new_price,
product.uom_id.id)
if product_avail[product.id] <= 0:
@@ -2717,7 +2717,7 @@ class stock_move(osv.osv):
qty = uom_obj._compute_qty(cr, uid, product_uom, product_qty, product.uom_id.id)
if qty > 0:
new_price = currency_obj.compute(cr, uid, product_currency,
- move_currency_id, product_price)
+ move_currency_id, product_price, round=False)
new_price = uom_obj._compute_price(cr, uid, product_uom, new_price,
product.uom_id.id)
if product.qty_available <= 0: