Merge lp:~openerp-dev/openobject-addons/7.0-stock-average-refresh-opw-607272-mat into lp:openobject-addons/7.0

Proposed by Martin Trigaux (OpenERP)
Status: Merged
Merged at revision: 10026
Proposed branch: lp:~openerp-dev/openobject-addons/7.0-stock-average-refresh-opw-607272-mat
Merge into: lp:openobject-addons/7.0
Diff against target: 13 lines (+3/-1)
1 file modified
stock/stock.py (+3/-1)
To merge this branch: bzr merge lp:~openerp-dev/openobject-addons/7.0-stock-average-refresh-opw-607272-mat
Reviewer Review Type Date Requested Status
OpenERP Core Team Pending
Review via email: mp+217619@code.launchpad.net

Description of the change

When we deliver a product with average cost, use the cost of the product at the time of delivery.

To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'stock/stock.py'
--- stock/stock.py 2014-04-23 15:06:21 +0000
+++ stock/stock.py 2014-04-29 14:54:17 +0000
@@ -2322,7 +2322,9 @@
23222322
2323 # if product is set to average price and a specific value was entered in the picking wizard,2323 # if product is set to average price and a specific value was entered in the picking wizard,
2324 # we use it2324 # we use it
2325 if move.product_id.cost_method == 'average' and move.price_unit:2325 if move.location_dest_id.usage != 'internal' and move.product_id.cost_method == 'average':
2326 reference_amount = qty * move.product_id.standard_price
2327 elif move.product_id.cost_method == 'average' and move.price_unit:
2326 reference_amount = qty * move.price_unit2328 reference_amount = qty * move.price_unit
2327 reference_currency_id = move.price_currency_id.id or reference_currency_id2329 reference_currency_id = move.price_currency_id.id or reference_currency_id
23282330