From a0e88c3d67ccd3daf4fed0bae62b3fbe6ec73e7b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Sat, 19 Oct 2024 23:06:22 +0200 Subject: [PATCH] Do not update unit price of stock move when it is not required Closes #13561 (grafted from f8cc5d68e4867431827d3a32e7f70db2d008262c) --HG-- branch : 7.0 --- modules/account_invoice_stock/stock.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/account_invoice_stock/stock.py b/modules/account_invoice_stock/stock.py index 702d59f4dc..6b6a92d222 100644 --- a/modules/account_invoice_stock/stock.py +++ b/modules/account_invoice_stock/stock.py @@ -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: