From 34b87b6d95fb33f04188b30d8818546bf566345d Mon Sep 17 00:00:00 2001 From: "Quentin (OpenERP)" Date: Tue, 28 May 2013 17:42:16 +0200 Subject: [PATCH] [REF] stock: added comment in price_calculation bzr revid: qdp-launchpad@openerp.com-20130528154216-fm6aozct85c1ip2t --- addons/stock/stock.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/addons/stock/stock.py b/addons/stock/stock.py index 1ebe99416e5..49fbe0e8fc2 100644 --- a/addons/stock/stock.py +++ b/addons/stock/stock.py @@ -2702,8 +2702,9 @@ class stock_move(osv.osv): product_avail[product.id] = product.qty_available # Check if out -> do stock move matchings and if fifo/lifo -> update price + # only update the cost price on the product form on stock moves of type == 'out' because if a valuation has to be made without PO, + # for inventories for example we want to use the last value used for an outgoing move if move.location_id.usage == 'internal' and move.location_dest_id.usage != 'internal': - fifo = (cost_method != 'lifo') tuples = product_obj.get_stock_matchings_fifolifo(cr, uid, [product.id], product_qty, fifo, product_uom, move.company_id.currency_id.id, context=ctx) #TODO Would be better to use price_currency_id for migration?