Site Overlay

Tryton country module

The country module keeps a list of pre-defined country names. It features a high granularity and is aware of provinces, districts etc. for rather exotic countries. The advantage of installing the module is to have a curated list of countries ready to pick from whenever a country information (e.g. for a Party address) has to be entered.

Installation

Given sufficient admin rights, the Tryton country module can simply be installed from the Modules menu:

  • Open the Modules list
  • Activate the check box of the currency entry
  • Click on the Fan button to trigger the installation

There is no necessity to explicitly run a command like trytond-admin --update-modules-list but it can’t do any harm either.

The great disappointment

The country list is empty…

If you expect to get a complete list of countries whenever you click into a country field in a mask (such as in the Party mask) you are in for a fat disappointment: Nothing is populated at all. All that the country module has so far done is that there is a Countries subsection of the adminstration menu with an empty countries list.

… but can be downloaded

Does this mean we have to enter every country by hand. Fortunately not, we can download a curated list with countries, organizations, translations… everything we need. Here’s how it works:

Bash into the docker container running the Tryton app:

Inside the Docker container run the following command that downloads the curated country data from a remote source into your Tryton database (which we assume has the name tryton_db):

The messages you get while downloading are quite verbose, contain some warnings about Python modules that are scheduled for deprecation. Still there are no errors or show stoppers.