|
@@ -5,9 +5,9 @@ from openerp.exceptions import Warning
|
|
|
class AccountBankStatement(models.Model):
|
|
|
_inherit = 'account.bank.statement'
|
|
|
|
|
|
- def button_cancel(self, cr, uid, ids, context=None):
|
|
|
- context['cancel_from_statement'] = True
|
|
|
- return super(AccountBankStatement, self).button_cancel(cr, uid, ids, context=context)
|
|
|
+ @api.multi
|
|
|
+ def button_cancel(self):
|
|
|
+ return super(AccountBankStatement, self.with_context(cancel_from_statement=True)).button_cancel()
|
|
|
|
|
|
class AccountBankStatementLine(models.Model):
|
|
|
_inherit = 'account.bank.statement.line'
|
|
@@ -15,6 +15,8 @@ class AccountBankStatementLine(models.Model):
|
|
|
voucher_id = fields.Many2one('account.voucher', 'Voucher', readonly=True)
|
|
|
|
|
|
def cancel(self, cr, uid, ids, context=None):
|
|
|
+
|
|
|
+ # import web_pdb; web_pdb.set_trace()
|
|
|
# if we are canceling the statement then we dont raise the warning
|
|
|
if context.get('cancel_from_statement', False):
|
|
|
none_voucher_ids = self.search(cr, uid, [('id', 'in', ids), ('voucher_id', '=', False)])
|