Issue 11078

Title
Support for iso-codes >= 4.8.0
Priority
wish
Status
closed
Superseder
The value "district with special status" for field "Type" in "Subdivision" is not one of the allowed options (issue 11128)
Nosy list
yangoon
Assigned to
Keywords

Created on 2021-12-21.21:56:52 by yangoon, last changed 10 months ago by ced.

Messages

Author: [hidden] (yangoon) Tryton translator
Date: 2022-01-10.20:27:58

JFYI: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1002073#31

FYI a new version of pycountry has now been released upstream and it includes
the iso-codes 4.8.0 data which presumably makes the tests fail upstream.
tryton upstream seem to want to be reactive rather than proactive in dealing
with this problem, so now is the time for them act, I guess.

Author: [hidden] (ced) Tryton committer Tryton translator
Date: 2021-12-22.09:13:15

If you really want but we are not going to do something for a problem that does not exist yet.

Author: [hidden] (yangoon) Tryton translator
Date: 2021-12-22.08:38:32

Therefore this is not a bug report, but a feature request.

Author: [hidden] (ced) Tryton committer Tryton translator
Date: 2021-12-21.23:00:41

The module still works correctly with the latest release of pycountry.

Author: [hidden] (yangoon) Tryton translator
Date: 2021-12-21.21:56:52

iso-codes 4.8. was released with some structural changes that lead to failures in the country import script. It seems pycountry is already adapted.

Relevant issues:
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1002073
https://ci.debian.net/data/autopkgtest/unstable/amd64/t/tryton-modules-country/17613199/log.gz
https://salsa.debian.org/debian/pycountry/-/blob/master/debian/control


/usr/lib/python3/dist-packages/trytond/modules/country/tests/scenario_country_import.rst
Doctest: scenario_country_import.rst ... Update countries
Update subdivisions
FAIL

======================================================================
FAIL: /usr/lib/python3/dist-packages/trytond/modules/country/tests/scenario_country_import.rst
Doctest: scenario_country_import.rst
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python3.9/doctest.py", line 2202, in runTest
    raise self.failureException(self.format_failure(new.getvalue()))
AssertionError: Failed doctest test for scenario_country_import.rst
  File "/usr/lib/python3/dist-packages/trytond/modules/country/tests/scenario_country_import.rst", line 0

----------------------------------------------------------------------
File "/usr/lib/python3/dist-packages/trytond/modules/country/tests/scenario_country_import.rst", line 21, in scenario_country_import.rst
Failed example:
    import_countries.do_import()
Exception raised:
    Traceback (most recent call last):
      File "/usr/lib/python3.9/doctest.py", line 1334, in __run
        exec(compile(example.source, filename, "single",
      File "<doctest scenario_country_import.rst[7]>", line 1, in <module>
        import_countries.do_import()
      File "/usr/lib/python3/dist-packages/trytond/modules/country/scripts/import_countries.py", line 169, in do_import
        subdivisions = update_subdivisions(countries, subdivisions)
      File "/usr/lib/python3/dist-packages/trytond/modules/country/scripts/import_countries.py", line 114, in update_subdivisions
        Subdivision.save(records)
      File "/usr/lib/python3/dist-packages/proteus/__init__.py", line 104, in newfunc
        return self.func(owner, *args, **kwargs)
      File "/usr/lib/python3/dist-packages/proteus/__init__.py", line 847, in save
        ids = proxy.create(values, context)
      File "/usr/lib/python3/dist-packages/proteus/config.py", line 198, in __call__
        result = rpc.result(meth(*args, **kwargs))
      File "/usr/lib/python3/dist-packages/trytond/modules/country/country.py", line 240, in create
        return super(Subdivision, cls).create(vlist)
      File "/usr/lib/python3/dist-packages/trytond/model/modelsql.py", line 159, in wrapper
        return func(cls, *args, **kwargs)
      File "/usr/lib/python3/dist-packages/trytond/model/modelsql.py", line 679, in create
        cls._validate(sub_records)
      File "/usr/lib/python3/dist-packages/trytond/model/modelstorage.py", line 79, in wrapper
        return func(*args, **kwargs)
      File "/usr/lib/python3/dist-packages/trytond/model/modelstorage.py", line 1347, in _validate
        raise SelectionValidationError(gettext(
    trytond.model.modelstorage.SelectionValidationError: The value "district with special status" for field "Type" in "Subdivision" is not one of the allowed options. - 


History
Date User Action Args
2022-01-11 16:48:48cedsetstatus: chatting -> closed
superseder: + The value "district with special status" for field "Type" in "Subdivision" is not one of the allowed options
2022-01-10 20:27:58yangoonsetmessages: + msg73187
2021-12-22 09:13:22cedsetnosy: - ced
2021-12-22 09:13:15cedsetmessages: + msg72881
nosy: ced, yangoon
priority: feature -> wish
status: chatting
2021-12-22 08:38:33yangoonsetmessages: + msg72880
status: invalid -> (no value)
2021-12-21 23:00:41cedsetmessages: + msg72858
nosy: + ced
status: unread -> invalid
2021-12-21 21:56:52yangooncreate

Showing 10 items. Show all history (warning: this could be VERY long)