[FIX] Account: dog slow invoice cancel because validate for every line; patch included
lp bug: https://launchpad.net/bugs/740353 fixed bzr revid: ara@tinyerp.com-20110324095631-pgup0qjn8s9jar0f
This commit is contained in:
parent
ff20865adf
commit
cb85ff64ca
|
@ -1087,12 +1087,15 @@ class account_move_line(osv.osv):
|
|||
move_obj = self.pool.get('account.move')
|
||||
self._update_check(cr, uid, ids, context)
|
||||
result = False
|
||||
move_ids = []
|
||||
for line in self.browse(cr, uid, ids, context=context):
|
||||
if line.move_id not in move_ids:
|
||||
move_ids.append(line.move_id.id)
|
||||
context['journal_id'] = line.journal_id.id
|
||||
context['period_id'] = line.period_id.id
|
||||
result = super(account_move_line, self).unlink(cr, uid, [line.id], context=context)
|
||||
if check:
|
||||
move_obj.validate(cr, uid, [line.move_id.id], context=context)
|
||||
if check:
|
||||
move_obj.validate(cr, uid, move_ids, context=context)
|
||||
return result
|
||||
|
||||
def _check_date(self, cr, uid, vals, context=None, check=True):
|
||||
|
|
Loading…
Reference in New Issue