[FIX] account_bank_statement_extensions: lines confirmation
Confirm lines of account cash statement on closing The `account_bank_statement_extensions` adds a state field to account.bank.statement.line and sets the status to 'confirm' when a bank statement is closed. When a cash statement is closed, the lines remained in draft. Closes #3584
This commit is contained in:
parent
f26df86ea9
commit
0fb00808b2
|
@ -38,8 +38,7 @@ class account_bank_statement(osv.osv):
|
||||||
res = super(account_bank_statement, self).write(cr, uid, ids, vals, context=context)
|
res = super(account_bank_statement, self).write(cr, uid, ids, vals, context=context)
|
||||||
return res
|
return res
|
||||||
|
|
||||||
def button_confirm_bank(self, cr, uid, ids, context=None):
|
def confirm_statement_lines(self, cr, uid, ids, context=None):
|
||||||
super(account_bank_statement, self).button_confirm_bank(cr, uid, ids, context=context)
|
|
||||||
for st in self.browse(cr, uid, ids, context=context):
|
for st in self.browse(cr, uid, ids, context=context):
|
||||||
if st.line_ids:
|
if st.line_ids:
|
||||||
cr.execute("UPDATE account_bank_statement_line \
|
cr.execute("UPDATE account_bank_statement_line \
|
||||||
|
@ -47,6 +46,16 @@ class account_bank_statement(osv.osv):
|
||||||
(tuple([x.id for x in st.line_ids]),))
|
(tuple([x.id for x in st.line_ids]),))
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
def button_confirm_bank(self, cr, uid, ids, context=None):
|
||||||
|
res = super(account_bank_statement, self).button_confirm_bank(cr, uid, ids, context=context)
|
||||||
|
self.confirm_statement_lines(cr, uid, ids, context=context)
|
||||||
|
return res
|
||||||
|
|
||||||
|
def button_confirm_cash(self, cr, uid, ids, context=None):
|
||||||
|
res = super(account_bank_statement, self).button_confirm_cash(cr, uid, ids, context=context)
|
||||||
|
self.confirm_statement_lines(cr, uid, ids, context=context)
|
||||||
|
return res
|
||||||
|
|
||||||
def button_cancel(self, cr, uid, ids, context=None):
|
def button_cancel(self, cr, uid, ids, context=None):
|
||||||
super(account_bank_statement, self).button_cancel(cr, uid, ids, context=context)
|
super(account_bank_statement, self).button_cancel(cr, uid, ids, context=context)
|
||||||
for st in self.browse(cr, uid, ids, context=context):
|
for st in self.browse(cr, uid, ids, context=context):
|
||||||
|
|
Loading…
Reference in New Issue