From a5f6215d637a966692fa70abf9e80fa72bfcf85f Mon Sep 17 00:00:00 2001 From: Sergi Almacellas Abellana Date: Mon, 26 Mar 2018 14:09:55 +0200 Subject: [PATCH] Use deactivable mixin issue4341 review38401002 --- bank.py | 11 +++-------- view/bank_account_list.xml | 1 - 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/bank.py b/bank.py index 6713e46ba0..0df5ed0799 100644 --- a/bank.py +++ b/bank.py @@ -3,7 +3,8 @@ from stdnum import iban from sql import operators, Literal -from trytond.model import ModelView, ModelSQL, fields, sequence_ordered +from trytond.model import ( + ModelView, ModelSQL, DeactivableMixin, fields, sequence_ordered) __all__ = ['Bank', 'BankAccount', 'BankAccountNumber', 'BankAccountParty'] @@ -24,7 +25,7 @@ class Bank(ModelSQL, ModelView): return [('party',) + tuple(clause[1:])] -class BankAccount(ModelSQL, ModelView): +class BankAccount(DeactivableMixin, ModelSQL, ModelView): 'Bank Account' __name__ = 'bank.account' bank = fields.Many2One('bank', 'Bank', required=True, @@ -35,12 +36,6 @@ class BankAccount(ModelSQL, ModelView): numbers = fields.One2Many('bank.account.number', 'account', 'Numbers', required=True, help="Add the numbers which identify the bank account.") - active = fields.Boolean('Active', select=True, - help="Uncheck to exclude the bank account from future use.") - - @staticmethod - def default_active(): - return True def get_rec_name(self, name): return self.numbers[0].number diff --git a/view/bank_account_list.xml b/view/bank_account_list.xml index 0e7358061d..74ae5261ff 100644 --- a/view/bank_account_list.xml +++ b/view/bank_account_list.xml @@ -5,5 +5,4 @@ this repository contains the full copyright notices and license terms. --> -