Add active field

issue7023
review52271002
This commit is contained in:
Xavier Codinas
2018-10-30 16:38:22 +01:00
parent 045d7630d5
commit b522391ae8
4 changed files with 13 additions and 6 deletions
+2
View File
@@ -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
+3 -3
View File
@@ -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',
+5 -2
View File
@@ -1,14 +1,17 @@
<?xml version="1.0"?>
<!-- This file is part of Tryton. The COPYRIGHT file at the top level of
this repository contains the full copyright notices and license terms. -->
<form>
<form col="6">
<label name="name"/>
<field name="name"/>
<label name="active"/>
<field name="active"/>
<newline/>
<label name="code"/>
<field name="code"/>
<label name="code3"/>
<field name="code3"/>
<label name="code_numeric"/>
<field name="code_numeric"/>
<field name="subdivisions" colspan="4"/>
<field name="subdivisions" colspan="6"/>
</form>
+3 -1
View File
@@ -1,7 +1,7 @@
<?xml version="1.0"?>
<!-- This file is part of Tryton. The COPYRIGHT file at the top level of
this repository contains the full copyright notices and license terms. -->
<form>
<form col="6">
<label name="country"/>
<field name="country"/>
<newline/>
@@ -9,6 +9,8 @@ this repository contains the full copyright notices and license terms. -->
<field name="name"/>
<label name="code"/>
<field name="code"/>
<label name="active"/>
<field name="active"/>
<label name="type"/>
<field name="type"/>
<label name="parent"/>