fix issue when creating empty statement (lp:1247876) and add a module which enables bank statement creation from the point of sale with the banking framework installed.

This commit is contained in:
unknown
2014-03-06 11:48:37 +01:00
committed by Yannick Vaucher
5 changed files with 193 additions and 4 deletions

View File

@@ -31,9 +31,10 @@ def fixed_write(self, cr, uid, ids, vals, context=None):
I will do it when I have time."""
res = super(stat_mod.account_bank_statement, self).write(cr, uid, ids,
vals, context=context)
cr.execute("UPDATE account_bank_statement_line"
" SET sequence = account_bank_statement_line.id + 1"
" where statement_id in %s", (tuple(ids),))
if ids: # will be false for an new empty bank statement
cr.execute("UPDATE account_bank_statement_line"
" SET sequence = account_bank_statement_line.id + 1"
" where statement_id in %s", (tuple(ids),))
return res
stat_mod.account_bank_statement.write = fixed_write