diff --git a/openupgrade_scripts/scripts/account/14.0.1.1/end-migration.py b/openupgrade_scripts/scripts/account/14.0.1.1/end-migration.py index 8285c7cba8b6..db3fc924708e 100644 --- a/openupgrade_scripts/scripts/account/14.0.1.1/end-migration.py +++ b/openupgrade_scripts/scripts/account/14.0.1.1/end-migration.py @@ -32,6 +32,14 @@ def _make_correct_account_type(env): ) +def _recompute_amount_residual(env): + account_move_lines_to_recompute = env['account.move.line'].search([ + ('parent_state', '=', 'posted'), + ('move_id.payment_state', 'in', ['not_paid', 'in_payment', 'partial'])]) + account_move_lines_to_recompute._compute_amount_residual() + + @openupgrade.migrate() def migrate(env, version): + _recompute_amount_residual(env) _make_correct_account_type(env)