Skip to content

Commit

Permalink
[FIX] stock: when delivering a product in average cost, make sure the…
Browse files Browse the repository at this point in the history
… price_unit on the stock.move is up to date (opw 607272)

bzr revid: mat@openerp.com-20140429145332-s3c22w47aihdsfub
  • Loading branch information
mart-e committed Apr 29, 2014
1 parent 9cf1419 commit 37c41f9
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion addons/stock/stock.py
Expand Up @@ -2322,7 +2322,9 @@ def _get_reference_accounting_values_for_valuation(self, cr, uid, move, context=

# if product is set to average price and a specific value was entered in the picking wizard,
# we use it
if move.product_id.cost_method == 'average' and move.price_unit:
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_currency_id = move.price_currency_id.id or reference_currency_id

Expand Down

0 comments on commit 37c41f9

Please sign in to comment.