mirror of
https://github.com/OCA/account-reconcile.git
synced 2025-01-20 12:27:39 +02:00
[IMP] no loop when computing sequence
This commit is contained in:
@@ -28,13 +28,12 @@ from openerp.tools.translate import _
|
|||||||
def fixed_write(self, cr, uid, ids, vals, context=None):
|
def fixed_write(self, cr, uid, ids, vals, context=None):
|
||||||
""" Fix performance desing of original function
|
""" Fix performance desing of original function
|
||||||
Ideally we should use a real postgres sequence or serial fields.
|
Ideally we should use a real postgres sequence or serial fields.
|
||||||
Will do it when I have time."""
|
I will do it when I have time."""
|
||||||
res = super(stat_mod.account_bank_statement, self).write(cr, uid, ids,
|
res = super(stat_mod.account_bank_statement, self).write(cr, uid, ids,
|
||||||
vals, context=context)
|
vals, context=context)
|
||||||
for s_id in ids:
|
cr.execute("UPDATE account_bank_statement_line"
|
||||||
cr.execute("UPDATE account_bank_statement_line"
|
" SET sequence = account_bank_statement_line.id + 1"
|
||||||
" SET sequence = account_bank_statement_line.id + 1"
|
" where statement_id in %s", (tuple(ids),))
|
||||||
" where statement_id = %s", (s_id,))
|
|
||||||
return res
|
return res
|
||||||
stat_mod.account_bank_statement.write = fixed_write
|
stat_mod.account_bank_statement.write = fixed_write
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user