openerp-india team mailing list archive
-
openerp-india team
-
Mailing list archive
-
Message #14353
[Bug 1034554] [NEW] account_move.unlink serious performance issue when has lot of lines
Public bug reported:
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_move_line'. However this doesn't produce the bottleneck.
- 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_move.unlink' can be removed safely.
** Affects: openobject-addons
Importance: Undecided
Status: New
** Description changed:
If you are deleting an account move with a lot of account move lines,
- both with code or with client interface, processing time rise
+ 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_move_line'. However this doesn't produce the bottleneck.
- 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_move.unlink' can be removed safely.
--
You received this bug notification because you are a member of OpenERP
Indian Team, which is subscribed to OpenERP Addons.
https://bugs.launchpad.net/bugs/1034554
Title:
account_move.unlink serious performance issue when has lot of lines
Status in OpenERP Addons (modules):
New
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_move_line'. However this doesn't produce the bottleneck.
- 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_move.unlink' can be removed safely.
To manage notifications about this bug go to:
https://bugs.launchpad.net/openobject-addons/+bug/1034554/+subscriptions
Follow ups
References