From f130a3747003a3973d1970aea506403cd28b8a40 Mon Sep 17 00:00:00 2001 From: "Corentin Thaon (thco)" Date: Fri, 17 Mar 2023 13:52:15 +0000 Subject: [PATCH] [FIX] account: state dependency _compute_amount Reintroduction of the dependency on the state of the account.move for the _compute_amount method. Some customers are experiencing problems following the migration to version 16. If they had draft 'account.move' before the migration, the 'amount_residual' field is set to 0 during the migration. When they validate the move after the migration, it goes directly to the paid status because the field is not recomputed. opw-3182437 opw-3196490 opw-3229872 closes odoo/odoo#116180 X-original-commit: 3c7f6c3e39c05d7dfd24dd1b73f7bb3f19230f72 Signed-off-by: Laurent Smet --- addons/account/models/account_move.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/addons/account/models/account_move.py b/addons/account/models/account_move.py index 94f7f34ee1a..7e0954c4cd5 100644 --- a/addons/account/models/account_move.py +++ b/addons/account/models/account_move.py @@ -864,7 +864,8 @@ class AccountMove(models.Model): 'line_ids.amount_residual', 'line_ids.amount_residual_currency', 'line_ids.payment_id.state', - 'line_ids.full_reconcile_id') + 'line_ids.full_reconcile_id', + 'state') def _compute_amount(self): for move in self: total_untaxed, total_untaxed_currency = 0.0, 0.0