[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
This commit is contained in:
Laetitia Gangloff 2015-01-06 14:36:31 +01:00 committed by Denis Ledoux
parent 65d4b25565
commit f9859c510c
1 changed files with 1 additions and 1 deletions

View File

@ -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