Instead of defining the new sequence as a field default, it is now a compute. This is because the sequence depends on the company, but we don't have the `company_id` field until the record is created.
Reduced the default number of padded zeroes to 8. This is a product decision.
The original implementation didn't make much sense because it allowed the user to set a different sequence per journal, but Odoo already has that kind of sequence. The only purpose of this module is to have a sequence *per company*. To avoid breaking too much, for now, when the journal sequence is the default one, we set it as readonly.
Limit the available sequences in the renumbering wizard. Display only those that you have access by your selected context companies. For some reason, Odoo doesn't filter sequences by company automatically.
@moduon MT-3076
Co-authored-by: Andrea Cattalani <22261939+anddago78@users.noreply.github.com>
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
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
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
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