From ea8bb553e270f12b03c2adf86bcfc8e5cbc2511b Mon Sep 17 00:00:00 2001 From: Jairo Llopis Date: Mon, 24 Apr 2023 10:09:27 +0100 Subject: [PATCH] [FIX] account_journal_general_sequence: avoid renaming bottleneck When renumbering the moves, a lot of recomputes were executed, specially after Yeeeeaah was merged (a.k.a. https://github.com/odoo/odoo/pull/96134). None of those recomputes is needed. The entry number we're adding here has no impact on taxes, invoices, or anything related. We can just skip all that stuff and make renumbering actually be able to finish in less than 100 years. @moduon MT-2806 --- .../wizards/account_move_renumber_wizard.py | 1 + 1 file changed, 1 insertion(+) diff --git a/account_journal_general_sequence/wizards/account_move_renumber_wizard.py b/account_journal_general_sequence/wizards/account_move_renumber_wizard.py index 692068a8..ff261c41 100644 --- a/account_journal_general_sequence/wizards/account_move_renumber_wizard.py +++ b/account_journal_general_sequence/wizards/account_move_renumber_wizard.py @@ -78,6 +78,7 @@ class AccountMoveRenumberWizard(models.TransientModel): current_range.sudo().number_next = self.starting_number self.sequence_id.sudo().number_next = self.starting_number # Renumber the moves + moves = moves.with_context(skip_invoice_sync=True) moves.entry_number = False moves.flush_recordset(["entry_number"]) moves._compute_entry_number()