Jairo Llopis 0aad5b6dd6 [FIX] account_journal_general_sequence: optimize recomputes when renumbering
When calling `_next()` in a sequence, it issues calls to `search()`, especially if it is a no-gap or date-range-based sequence (which is common in this use case).

When doing a search, Odoo triggers recomputations. Thus, when doing both a write and a call to `_next()` in the same loop, Odoo had to flush to DB too often, causing a bottleneck.

Now, the process is more optimized:
1. Cache all new entry numbers.
2. Write them all.
3. Mark them all as modified at once, to batch-trigger recomputations.

To reduce the amount of recomputations, tracking is disabled for the entry number. After all, before renumbering there's already a warning telling you that you shouldn't renumber if you already published those entry numbers to your fiscal authority.

Another pseudo-improvement is that the info log is shorter. Enable debug logging to log the list of IDs changed.

A test was failing because it was relying on the fact that computations were not getting as lazy as they should. Manual flushes are added to imitate a user doing different invoice creations.

@moduon MT-3082
2023-06-26 12:55:30 +01:00
2023-02-08 08:31:52 +00:00
2023-02-09 16:56:44 +00:00
2022-04-04 11:19:32 +00:00
2022-05-05 10:34:47 +00:00
2023-05-11 10:50:39 +00:00
2021-10-17 16:32:50 +02:00
2022-03-30 21:38:26 +02:00
2021-10-17 16:32:50 +02:00
2022-11-03 17:34:52 +01:00
2021-10-17 16:32:50 +02:00
2021-10-17 16:32:50 +02:00
2022-11-03 17:34:52 +01:00
2022-11-03 17:34:52 +01:00
2021-10-17 16:32:50 +02:00
2023-06-26 06:01:03 +00:00

Runboat Pre-commit Status Build Status codecov Translation Status

account-financial-tools

TODO: add repo description.

Available addons

addon version maintainers summary
account_asset_low_value 15.0.1.0.0 kittiu Assets Management - Low Value Asset
account_asset_management 15.0.1.0.3 Assets Management
account_asset_management_menu 15.0.1.0.0 Assets Management Menu
account_asset_number 15.0.1.0.0 Assets Number
account_balance_line 15.0.1.1.0 Display balance totals in move line view
account_chart_update 15.0.1.2.0 Wizard to update a company's account chart from a template
account_chart_update_l10n_eu_oss 15.0.1.0.0 LoisRForgeFlow Account Chart update OSS
account_chart_update_l10n_eu_oss_oca 15.0.1.0.0 LoisRForgeFlow Account Chart update OSS OCA
account_check_deposit 15.0.1.0.0 Manage deposit of checks to the bank
account_cost_center 15.0.1.0.0 Cost center information for invoice lines
account_fiscal_month 15.0.1.0.0 Provide a fiscal month date range type
account_fiscal_position_vat_check 15.0.1.0.1 Check VAT on invoice validation
account_fiscal_year 15.0.1.3.0 eLBati Create Account Fiscal Year
account_invoice_constraint_chronology 15.0.1.0.1 Account Invoice Constraint Chronology
account_journal_general_sequence 15.0.1.0.6 yajo Add configurable sequence to account moves, per journal
account_journal_lock_date 15.0.1.0.1 Lock each journal independently
account_lock_date_update 15.0.1.0.1 Allow an Account adviser to update locking date without having access to all technical settings
account_lock_to_date 15.0.1.0.0 Allows to set an account lock date in the future.
account_maturity_date_default 15.0.1.0.0 victoralmau Account Maturity Date Default
account_move_budget 15.0.1.0.0 Create Accounting Budgets
account_move_fiscal_month 15.0.1.0.0 Display the fiscal month on journal entries/item
account_move_fiscal_year 15.0.1.0.1 Display the fiscal year on journal entries/item
account_move_force_removal 15.0.1.1.0 Allow force removal account moves
account_move_line_menu 15.0.1.0.0 Adds a Journal Items menu
account_move_line_purchase_info 15.0.1.1.1 Introduces the purchase order line to the journal items
account_move_line_residual 15.0.1.0.1 Display residual amount in move line view
account_move_line_sale_info 15.0.1.0.3 Introduces the purchase order line to the journal items
account_move_line_tax_editable 15.0.1.0.1 Allows to edit taxes on non-posted account move lines
account_move_name_sequence 15.0.1.2.1 alexis-via moylop260 frahikLV Generate journal entry number from sequence
account_move_print 15.0.1.0.0 JordiBForgeFlow Adds the option to print Journal Entries
account_move_template 15.0.1.0.0 Templates for recurring Journal Entries
account_move_total_by_account_internal_group 15.0.1.0.0 Adds Totals by Account Internal Group in Journal Entries
account_netting 15.0.1.0.0 Compensate AR/AP accounts from the same partner
account_usability 15.0.1.0.2 legalsylvain Adds missing menu entries for Account module and adds the option to enable Saxon Accounting
base_vat_optional_vies 15.0.1.0.3 Optional validation of VAT via VIES
product_category_tax 15.0.1.1.0 Configure taxes in the product category

Licenses

This repository is licensed under AGPL-3.0.

However, each module can have a totally different license, as long as they adhere to Odoo Community Association (OCA) policy. Consult each module's __manifest__.py file, which contains a license key that explains its license.


OCA, or the Odoo Community Association, is a nonprofit organization whose mission is to support the collaborative development of Odoo features and promote its widespread use.

Description
Odoo Accountant Financial Tools and Utils
Readme 117 MiB
Languages
Python 61.9%
HTML 38.1%