diff --git a/account_constraints/model/account_bank_statement.py b/account_constraints/model/account_bank_statement.py index e1a3b35de..68fe0c8b1 100644 --- a/account_constraints/model/account_bank_statement.py +++ b/account_constraints/model/account_bank_statement.py @@ -62,3 +62,17 @@ class AccountBankStatementLine(models.Model): self = self.with_context(from_parent_object=True) return super(AccountBankStatementLine, self)\ .process_reconciliation(mv_line_dicts) + + @api.multi + def _is_account_cancel_installed(self): + ir_module = self.env['ir.module.module'] + res_found_module = ir_module.search_count([ + ('name', '=', 'account_cancel'), + ('state', '=', 'installed')]) + if res_found_module: + for line in self: + line.account_cancel_installed = True + + account_cancel_installed = fields.Boolean( + compute='_is_account_cancel_installed', + string='Allow Cancelling Entries') diff --git a/account_constraints/view/account_bank_statement.xml b/account_constraints/view/account_bank_statement.xml index b1c7f3e48..cf1b4c3e8 100644 --- a/account_constraints/view/account_bank_statement.xml +++ b/account_constraints/view/account_bank_statement.xml @@ -13,7 +13,8 @@ -