Skip to content

Commit b463aec

Browse files
AaronHForgeFlowMiquelRForgeFlow
authored andcommitted
[IMP] stock_account: in fifo, use price_unit of move in out svl
1 parent 83ae489 commit b463aec

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

addons/stock_account/migrations/13.0.1.1/post-migration.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -220,8 +220,12 @@ def generate_stock_valuation_layer(env):
220220
svl_in_vals_list[svl_in_index]["remaining_qty"] = 0.0
221221
svl_in_vals_list[svl_in_index]["remaining_value"] = 0.0
222222
svl_in_index += 1
223-
svl_vals = _prepare_out_svl_vals(
224-
move, move["product_qty"], previous_price, product)
223+
if product.cost_method == 'fifo':
224+
svl_vals = _prepare_out_svl_vals(
225+
move, move["product_qty"], move["price_unit"], product)
226+
else:
227+
svl_vals = _prepare_out_svl_vals(
228+
move, move["product_qty"], previous_price, product)
225229
svl_out_vals_list.append(svl_vals)
226230
previous_qty -= move["product_qty"]
227231
# Add manual adjusts after last move

0 commit comments

Comments
 (0)