2
0
Commit Graph

29 Commits

Author SHA1 Message Date
Jairo Llopis
4e15e63732
[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 13:50:12 +01:00
Weblate
ad6f4412b8 Update translation files
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

Translation: account-financial-tools-16.0/account-financial-tools-16.0-account_journal_general_sequence
Translate-URL: https://translation.odoo-community.org/projects/account-financial-tools-16-0/account-financial-tools-16-0-account_journal_general_sequence/
2023-06-23 11:47:29 +00:00
OCA-git-bot
68540bb7b7 account_journal_general_sequence 16.0.1.0.4 2023-06-23 11:47:09 +00:00
Jairo Llopis
c08d76e211
[FIX] account_journal_general_sequence: unique entry number per journal
The sequence is applied per journal. Thus, we can't require one number per company, but per journal.

@moduon MT-3082
2023-06-23 12:34:07 +01:00
Bole
942dd2e00d Translated using Weblate (Croatian)
Currently translated at 70.0% (21 of 30 strings)

Translation: account-financial-tools-16.0/account-financial-tools-16.0-account_journal_general_sequence
Translate-URL: https://translation.odoo-community.org/projects/account-financial-tools-16-0/account-financial-tools-16-0-account_journal_general_sequence/hr/
2023-05-25 15:09:32 +00:00
Bole
c8698b15af Added translation using Weblate (Croatian) 2023-05-25 12:43:44 +00:00
OCA-git-bot
49cba676e1 account_journal_general_sequence 16.0.1.0.3 2023-04-24 09:14:16 +00:00
Jairo Llopis
ea8bb553e2
[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
2023-04-24 10:09:27 +01:00
OCA-git-bot
11a9075f5f account_journal_general_sequence 16.0.1.0.2 2023-02-01 09:09:50 +00:00
Jairo Llopis
7e19ddd71c
[FIX] account_journal_general_sequence: let non admins delete sequence ranges
When the renumbering was done after a later sequence date range got added, the wizard was asking for admin permissions. Account managers are the ones that should take this decision, though. Fixed now.

@moduon MT-2185
2023-02-01 09:04:14 +00:00
OCA-git-bot
c2594cc54c account_journal_general_sequence 16.0.1.0.1 2022-12-23 11:21:56 +00:00
OCA-git-bot
db1e88de1a [UPD] README.rst 2022-12-23 11:21:55 +00:00
oca-ci
44c2c0285c [UPD] Update account_journal_general_sequence.pot 2022-12-23 11:18:43 +00:00
Jairo Llopis
a6cbbed493
[MIG] account_journal_general_sequence: v16 modifications
@moduon MT-1921
2022-12-23 10:47:11 +00:00
OCA-git-bot
78367e5399
account_journal_general_sequence 15.0.1.0.4 2022-12-23 10:22:44 +00:00
Jairo Llopis
9cf19e12a4
[FIX] account_journal_general_sequence: let non-admin accounting managers renumber moves
Before this patch, if users were accounting managers but not system administrators, they couldn't execute the account move renumbering.

Now that's fixed and tested.

@moduon MT-1728
2022-12-23 10:22:44 +00:00
OCA-git-bot
731c687a01
account_journal_general_sequence 15.0.1.0.3 2022-12-23 10:22:44 +00:00
Eduardo De Miguel
2c8993856a
[FIX] Add entry_number field in ledger reports views 2022-12-23 10:22:44 +00:00
OCA-git-bot
95d08792c3
account_journal_general_sequence 15.0.1.0.2 2022-12-23 10:22:43 +00:00
OCA-git-bot
df1ff62bf9
[UPD] README.rst 2022-12-23 10:22:43 +00:00
Jairo Llopis
4183ec5f5d
[FIX] account_journal_general_sequence: bottleneck at install
On databases with big amounts of account moves, installation would freeze Odoo for some minutes.

We skip now entry number computation at install, to avoid such cases.

@moduon MT-676
2022-12-23 10:22:43 +00:00
OCA-git-bot
5ced6ad1d8
account_journal_general_sequence 15.0.1.0.1 2022-12-23 10:22:43 +00:00
OCA-git-bot
a8dab75c42
[UPD] README.rst 2022-12-23 10:22:43 +00:00
oca-ci
af866d2080
[UPD] Update account_journal_general_sequence.pot 2022-12-23 10:22:43 +00:00
Jairo Llopis
cbff18b70f
[MIG] account_journal_general_sequence: Migration to 15.0 2022-12-23 10:22:43 +00:00
OCA-git-bot
a58a08b5a5
[UPD] README.rst 2022-12-23 10:22:43 +00:00
oca-ci
9f057cf025
[UPD] Update account_journal_general_sequence.pot 2022-12-23 10:22:43 +00:00
Jairo Llopis
67945e427a
[FIX] account_journal_general_sequence: support renumber starting from zero
This is a special case when working with `ir.sequence`.

@moduon MT-676
2022-12-23 10:22:43 +00:00
Jairo Llopis
1a1d816c7b
[ADD] account_journal_general_sequence: account move entry sequence
Under some legislations, account moves must follow a single sequence. Since Odoo removed this sequence number in recent versions, this information was lost.

With this module, you can force your account moves to follow a separate sequence. The sequence is automatic when a move is posted. Includes a wizard to reorder those numbers in the sequence.

@moduon MT-676
2022-12-23 10:22:43 +00:00