changeset 2ab9fb13824c in modules/country:default
details: https://hg.tryton.org/modules/country?cmd=changeset&node=2ab9fb13824c
description:
        Remove required on subdivision code

        issue11683
        review421641003
diffstat:

 country.py |  5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diffs (22 lines):

diff -r f3dcbc141d17 -r 2ab9fb13824c country.py
--- a/country.py        Thu Sep 08 13:21:18 2022 +0200
+++ b/country.py        Thu Sep 08 13:33:44 2022 +0200
@@ -107,7 +107,7 @@
         help="The country where this subdivision is.")
     name = fields.Char('Name', required=True, select=True, translate=True,
         help="The main identifier of the subdivision.")
-    code = fields.Char('Code', required=True, select=True,
+    code = fields.Char('Code', select=True,
         help="The ISO code of the subdivision.")
     flag = fields.Function(fields.Char("Flag"), 'on_change_with_flag')
     type = fields.Selection([
@@ -283,6 +283,9 @@
         # Migration from 6.2: remove type required
         table_h.not_null_action('type', action='remove')
 
+        # Migration from 6.4: remove required on code
+        table_h.not_null_action('code', action='remove')
+
     @fields.depends('code')
     def on_change_with_flag(self, name=None):
         if self.code:

Reply via email to