Skip to content
Snippets Groups Projects
Commit eabcb9ff authored by Josse Colpaert's avatar Josse Colpaert Committed by Nicolas Martinelli
Browse files

[FIX] stock_account: setting standard price with multiple real-price outs with...

[FIX] stock_account: setting standard price with multiple real-price outs with negative quants fixes #24925

Somehow the function treated multiple records with
 the new api translation from 9 to 10.

Steps to reproduce:
This applies to delivery orders and manufacturing orders. As an example:

Create an MO with 2 products on the BOM
Both products must have real time costing with FIFO
The first product on the bom must not be available
For the second product on the BOM, the standard_price must be different from the cost of the next quant to be consumed
Complete the MO, letting the first product result in a negative quant
Current behavior:
The standard_price of the second product on the BOM does not get updated.

Behavior after this fix:
The standard_price of the second product on the BOM gets updated.

Thanks to matt454357.
parent 63401868
No related branches found
No related tags found
No related merge requests found
......@@ -223,7 +223,7 @@ class StockMove(models.Model):
# product_obj = self.pool.get('product.product')
if any(q.qty <= 0 for q in move.quant_ids) or move.product_qty == 0:
# if there is a negative quant, the standard price shouldn't be updated
return
continue
# Note: here we can't store a quant.cost directly as we may have moved out 2 units
# (1 unit to 5€ and 1 unit to 7€) and in case of a product return of 1 unit, we can't
# know which of the 2 costs has to be used (5€ or 7€?). So at that time, thanks to the
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment