[account] slow invoice cancel because validate for every line; patch included
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Odoo Addons (MOVED TO GITHUB) |
Fix Released
|
Low
|
OpenERP R&D Addons Team 3 |
Bug Description
Try to create a large invoice with like 100 lines and validate it (it's slow but that's for an other one).
Now let's cancel it.
It's kind of slow like hell right?
In production with customer, it takes like 15 minutes to cancel... Not very user friendly...
Now let's analyse why.
Let's put some print statement in the account_
You'll see that instead of passing here once per invoice, we are passing here once per invoice line, after we remove every single move line. This is stupid, we can do it only once after removing the lines.
This issue is that the generic unlink method from account_move_lines is not smart enough to take in consideration the case where all move lines belong to the same account move. But this is very common, especially in our common cancel invoice use case!
Given how slow the account_
The included patch just do that. Thank you to apply it, OpenERP users will thank you a lot.
Before our patch: 50 lines invoices would take 15 minutes to cancel; it now takes only 10 seconds. Call it an improvement ;-)
Related branches
- Ashvin Rathod (OpenERP) (community): Needs Resubmitting
- Olivier Dony (Odoo): Needs Fixing
- qdp (OpenERP): Pending requested
-
Diff: 21 lines (+5/-2)1 file modifiedaccount/account_move_line.py (+5/-2)
Changed in openobject-addons: | |
status: | Confirmed → In Progress |
summary: |
- [account] dog slow invoice cancel because validate for every line; patch + [account] slow invoice cancel because validate for every line; patch included |
Changed in openobject-addons: | |
status: | Fix Committed → Fix Released |
The patch looks good for me, a similar patch could be applied on 5.0 too.