account_move.unlink serious performance issue when has lot of lines
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Odoo Addons (MOVED TO GITHUB) |
Confirmed
|
Wishlist
|
OpenERP R&D Addons Team 3 |
Bug Description
If you are deleting an account move with a lot of account move lines, both with code or with client interface, processing time rises exponentially.
Browsing the code, I can see two reasons for this:
- '_update_check' method of 'account_move_line' is called twice. Once in 'unlink' method of 'account_move' and other in 'unlink' method of 'account_
- In 'unlink' method of 'account_move', before calling super, 'unlink' method of 'account_move_line' is called, but one optional parameter called 'check' is not present, causing that after every line deleted method 'validate' is called, which slow down a lot the operation.
SOLUTION: I think that calling 'unlink' method of 'account_move_line' with parameter 'check=False' is safe, because you are removing entire account move, and avoid this bottleneck. Also, the '_update_check' call in 'account_
description: | updated |
Changed in openobject-addons: | |
assignee: | nobody → OpenERP R&D Addons Team 3 (openerp-dev-addons3) |
importance: | Undecided → Wishlist |
status: | New → Confirmed |