From 7f4e274c03cbed564320631a0268095e929598ac Mon Sep 17 00:00:00 2001 From: Arnold Moyaux Date: Fri, 13 Jan 2023 15:26:16 +0000 Subject: [PATCH] [FIX] stock_account: wrong label after invoice modification Usecase to reproduce: -2 products setup as Periodic valuation - Create a PO to buy both products - Receipt and create the bill - Modify the price unit on both invoice line to create correction layers The label on the journal items have the same label relative to only one of the products. It should keep the same label than before the confirmation. closes odoo/odoo#114792 X-original-commit: 226ae25b5f93164f14c1e68ed8bc2ea8a48b4e27 Signed-off-by: William Henrotin (whe) --- addons/stock_account/models/account_move.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/addons/stock_account/models/account_move.py b/addons/stock_account/models/account_move.py index 23cdf1f7f7e..a8bc2efe279 100644 --- a/addons/stock_account/models/account_move.py +++ b/addons/stock_account/models/account_move.py @@ -78,6 +78,8 @@ class AccountMove(models.Model): for layer in stock_valuation_layers: description = f"{layer.account_move_line_id.move_id.display_name} - {layer.product_id.display_name}" layer.description = description + if layer.product_id.valuation != 'real_time': + continue layer.account_move_id.ref = description layer.account_move_id.line_ids.write({'name': description})