From b522391ae8de263fe866536b494c2fcf29cfe9de Mon Sep 17 00:00:00 2001 From: Xavier Codinas Date: Tue, 30 Oct 2018 16:38:22 +0100 Subject: [PATCH] Add active field issue7023 review52271002 --- CHANGELOG | 2 ++ country.py | 6 +++--- view/country_form.xml | 7 +++++-- view/subdivision_form.xml | 4 +++- 4 files changed, 13 insertions(+), 6 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 509131915a..7b17026336 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,5 @@ +* Add active field on country and subdivision + Version 5.0.0 - 2018-10-01 * Bug fixes (see mercurial logs for details) * Remove support for Python 2.7 diff --git a/country.py b/country.py index 639d09666f..ea31a5f54d 100644 --- a/country.py +++ b/country.py @@ -1,12 +1,12 @@ # This file is part of Tryton. The COPYRIGHT file at the top level of # this repository contains the full copyright notices and license terms. -from trytond.model import ModelView, ModelSQL, fields +from trytond.model import ModelView, ModelSQL, DeactivableMixin, fields from trytond.pyson import Eval __all__ = ['Country', 'Subdivision', 'Zip'] -class Country(ModelSQL, ModelView): +class Country(DeactivableMixin, ModelSQL, ModelView): 'Country' __name__ = 'country.country' name = fields.Char('Name', required=True, translate=True, @@ -69,7 +69,7 @@ class Country(ModelSQL, ModelView): super(Country, cls).write(*args) -class Subdivision(ModelSQL, ModelView): +class Subdivision(DeactivableMixin, ModelSQL, ModelView): "Subdivision" __name__ = 'country.subdivision' country = fields.Many2One('country.country', 'Country', diff --git a/view/country_form.xml b/view/country_form.xml index 3ec5926f91..f62457bd67 100644 --- a/view/country_form.xml +++ b/view/country_form.xml @@ -1,14 +1,17 @@ -
+