Do not update unit price of stock move when it is not required

Closes #13561
(grafted from f8cc5d68e4867431827d3a32e7f70db2d008262c)

--HG--
branch : 7.0
This commit is contained in:
Cédric Krier
2024-10-19 23:06:22 +02:00
parent aef0d76496
commit a0e88c3d67
+1 -1
View File
@@ -90,7 +90,7 @@ class Move(metaclass=PoolMeta):
@classmethod
def update_unit_price(cls, moves):
for move in moves:
if move.state == 'done':
if move.state == 'done' and move.unit_price_required:
unit_price = move._compute_unit_price(
unit_price=move.unit_price)
if unit_price != move.unit_price: