From f9859c510c8687e071002c8445df1d5e696d1375 Mon Sep 17 00:00:00 2001 From: Laetitia Gangloff Date: Tue, 6 Jan 2015 14:36:31 +0100 Subject: [PATCH] [FIX] stock: compute stock valuation with right quantity `qty` is the quantity in the product default uom. `move.price_unit` is the price unit of the product in this move, for the specific uom of this move. The quantity to use is therefore the quantity in the move uom, `move.product_qty` Closes #4555 --- addons/stock/stock.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/stock/stock.py b/addons/stock/stock.py index 7fa2f4e92a2..e8cdbca3105 100644 --- a/addons/stock/stock.py +++ b/addons/stock/stock.py @@ -2328,7 +2328,7 @@ class stock_move(osv.osv): if move.location_dest_id.usage != 'internal' and move.product_id.cost_method == 'average': reference_amount = qty * move.product_id.standard_price elif move.product_id.cost_method == 'average' and move.price_unit: - reference_amount = qty * move.price_unit + reference_amount = move.product_qty * move.price_unit reference_currency_id = move.price_currency_id.id or reference_currency_id # Otherwise we default to the company's valuation price type, considering that the values of the