mirror of
https://github.com/OCA/account-reconcile.git
synced 2025-01-20 12:27:39 +02:00
[FIX] account_statement: crash when creating a new bank statement without any lines
This commit is contained in:
@@ -31,6 +31,7 @@ def fixed_write(self, cr, uid, ids, vals, context=None):
|
|||||||
I 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)
|
||||||
|
if ids: # will be false for an new empty bank statement
|
||||||
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 in %s", (tuple(ids),))
|
||||||
|
|||||||
Reference in New Issue
Block a user