From 8bc292afcd255d7a13ffadc045ab251c994981e0 Mon Sep 17 00:00:00 2001 From: chv-odoo Date: Fri, 25 Aug 2017 14:29:05 +0530 Subject: [PATCH] [IMP] account: remove 'cancel' button in bank statements that button was not useful: the only way to cancel a bank statement is to unreconcile the entries. And to unreconcile the entries you have to set your bank statement back to draft. Was PR #16632 --- addons/account/models/account_bank_statement.py | 7 ------- addons/account/views/account_view.xml | 1 - .../models/account_bank_statement.py | 14 -------------- addons/account_cancel/views/account_views.xml | 2 +- 4 files changed, 1 insertion(+), 23 deletions(-) diff --git a/addons/account/models/account_bank_statement.py b/addons/account/models/account_bank_statement.py index b90f563c354..377a39222d6 100644 --- a/addons/account/models/account_bank_statement.py +++ b/addons/account/models/account_bank_statement.py @@ -218,13 +218,6 @@ class AccountBankStatement(models.Model): 'target': 'new' } - @api.multi - def button_cancel(self): - for statement in self: - if any(line.journal_entry_ids.ids for line in statement.line_ids): - raise UserError(_('A statement cannot be canceled when its lines are reconciled.')) - self.state = 'open' - @api.multi def check_confirm_bank(self): if self.journal_type == 'cash' and not self.currency_id.is_zero(self.difference): diff --git a/addons/account/views/account_view.xml b/addons/account/views/account_view.xml index f08c0c016fc..29870e634a8 100644 --- a/addons/account/views/account_view.xml +++ b/addons/account/views/account_view.xml @@ -561,7 +561,6 @@