← Back to team overview

openerp-india team mailing list archive

[Bug 1034554] Re: account_move.unlink serious performance issue when has lot of lines

 

** Changed in: openobject-addons
   Importance: Undecided => Wishlist

** Changed in: openobject-addons
       Status: New => Confirmed

** Changed in: openobject-addons
     Assignee: (unassigned) => OpenERP R&D Addons Team 3 (openerp-dev-addons3)

-- 
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):
  Confirmed

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


References