-
Notifications
You must be signed in to change notification settings - Fork 23.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG] account: Concurrency errors increased considerably in account.move for Odoo>=v14.0 #91873
Comments
FWIW Spain is such exception. Translating from RD 1619/2012, article 6.1:
So, whatever the solution is, we need to cover both cases. Of course, the no-gap case seems more difficult. Has anybody explained why did this change? Why the v13's |
I think the same The The author of the new account numbering looks like: Actually, see the following new feature for future v16.0: It means, after all costs, resequence wizard is even needed? |
For example in Spain, as quoted in #91873 (comment), resequencing is illegal (in invoice numbers). I really can't understand why the change in v14 if all was working fine before. If it was just for the UX of being able to let anybody write the invoice number they like (which is BTW very dangerous)... Wouldn't it have been better to just add some computed+inverse fields that mangle with the @moylop260 would you be so kind to open an OPW so we know somebody in Odoo reads this thread? Thanks for your work on the matter BTW. |
FYI OPW#2879097 |
This is one of the things Odoo accounting is very naive. Invoices in most of the country is a document that is defined by the government. Specially country with SAFT it's not allowed to change the number of you invoice. Actually make no sense to provide you customer with invoice number XSF/xxxx and then after the customer already reported to the government you have the same invoice with another number. This kind of feature are not features but just gives lot's of problems. See in Portugal that use SAF-T. you are not allowed to change documents number. |
For record, I have co-created (original author by @alexis-via) the following module to mitigate these concurrency errors using the v13.0 old way: It looks more people is affecting this issue, check the following threads: |
@moylop260 thank you for this module we started to use it. A first fix we did locally was to remove this |
regarding gaps -> in Poland invoice numers should not have gaps, however if the gap occurs, accountant needs to create a statement/document saying why the gap occurred. So there is a workaround for gaps. |
For record, PR related #104345 Thanks a lot! |
…e sequences Related to odoo#90465 Reproducing all the new cases of concurrency for Odoo v14.0 account.move records in the following cases: - Creating draft invoices - Creating payments - Deadlock payment vs invoice - Editing last invoice and creating new one - Editing last payment and creating new one - Reconciling last invoice and creating new one - Reconciling last payment and creating new one - No be able to configure to standard sequences anymore All these kind of errors are raising other kind of errors related to subscription in payment exception, sale order in draft but with transaction, pos order errors, ecommerce users raising errors after pay then request the pay again and again and so on All workers are used waiting for releases in the queue Issue describing this: - odoo#91873 Foward-Porting: - odoo#91525
Fixed for >=v16.0 from #104606 |
…e sequences Related to odoo#90465 Reproducing all the new cases of concurrency for Odoo v14.0 account.move records in the following cases: - Creating draft invoices - Creating payments - Deadlock payment vs invoice - Editing last invoice and creating new one - Editing last payment and creating new one - Reconciling last invoice and creating new one - Reconciling last payment and creating new one - No be able to configure to standard sequences anymore All these kind of errors are raising other kind of errors related to subscription in payment exception, sale order in draft but with transaction, pos order errors, ecommerce users raising errors after pay then request the pay again and again and so on All workers are used waiting for releases in the queue Issue describing this: - odoo#91873 Foward-Porting: - odoo#91525
Impacted versions:
14.0, 15.0 and current master futures? (After the following commit: dfd01b8)
Steps to reproduce:
Invoice means:
Payment means:
Scenario 1 - Draft Invoices
Scenario 2 - Edit any field of the last posted invoice
Scenario 3 - Edit any field of the last posted payment
Same than scenario 2 but using payment
Scenario 4 - Reconcile the last invoice
Scenario 5 - Reconcile the last payment
Same than 4 but using payment
Scenario 4 - Create 2 payments
Scenario 5 - Create 2 miscellaneous journal entries
Scenario 6 - Create payment then invoice and invoice then payment
Current behavior:
All these cases have concurrent issues
Even the last one has a deadlock one
I have reproduced almost all these cases in the following unittests:
- Notice v13.0 is configured as no-gap and even it is not raising these kind of error as v14.0
Odoo is not prepared for these kinds of errors since that:
Expected behavior:
We have too many solution to discuss here for future versions (not stable ones)
Possible solution 1
Use a different table to lock the next numbering and don’t allow to request a new number if it is locked from another process to avoid gaps
and only locks if you are posting the move not draft ones
It will fix a lot of concurrent issues even if you are using no-gap like <=v13.0 using ir.sequence
Even It could allow to the user relax the no gaps for a few stressed journals since that the wizard to resequence could allow you to fill the gaps for all the companies or countries where it is strictly needed
Possible solution 2
Prepare odoo for all these “expected” locks, raises, rollbacks
It could be done by creating the crons to assign one by one journal entry numberingIt could be done by creating the journal entry numbering asynchronous
The problem with this is related to cases where you need to make an invoice to make a payment to reconcile together in the same process
So you will need to make the invoice and then wait for numbering finishes
then make payment then wait for numbering finishes
then reconcile
And it could require change many current process of Odoo
Possible solution 3
Analyze what are doing the other big system as Quickbox or SAP
I do not think they are doing the same than Odoo v14.0 since that it could be not usable for big companies with many users
I quickly looked for on the internet the keywords "gaps number invoice {SYSTEM}"
SAP:
https://userapps.support.sap.com/sap/support/knowledge/en/2766068
I think it means, it has an option to configure sequences based in Italy in order to have no-gap
Notice that the exception are no-gap instead but even there is an option to disable it (similar to Odoo v13.0)
Quickbox
Gaps are allowed since there is a report to show Deleted/Voided number invoices
Maybe it could be re-created the moves with zero amounts, resequencing or only a report of gaps is enough? IDK
_____ (Another big system)?
... (look for how it is done in other systems)
The text was updated successfully, but these errors were encountered: