Issue 8346

Title
Load and update pycountry data from script
Priority
feature
Status
resolved
Nosy list
ced, pokoli, resteve, reviewbot, roundup-bot
Assigned to
ced
Keywords
review

Created on 2019-05-10.19:24:14 by ced, last changed 38 months ago by roundup-bot.

Messages

New changeset e05b79b89515 by Cédric Krier in branch 'default':
Rename language pattern into language_code
https://hg.tryton.org/tryton-env/rev/e05b79b89515
New changeset 2144c71d868d by Cédric Krier in branch 'default':
Rename language pattern into language_code
https://hg.tryton.org/modules/party/rev/2144c71d868d
New changeset bfab5eff21bd by Cédric Krier in branch 'default':
Load and update pycountry data from script
https://hg.tryton.org/tryton-env/rev/bfab5eff21bd
New changeset 6794fd13cb64 by Cédric Krier in branch 'default':
Load and update pycountry data from script
https://hg.tryton.org/modules/party/rev/6794fd13cb64
New changeset e83a477968ca by Cédric Krier in branch 'default':
Load and update pycountry data from script
https://hg.tryton.org/modules/currency/rev/e83a477968ca
New changeset 416223b2a093 by Cédric Krier in branch 'default':
Load and update pycountry data from script
https://hg.tryton.org/modules/country/rev/416223b2a093
Author: [hidden] (pokoli) Tryton committer Tryton translator
Date: 2019-07-26.09:46:16
> There is no mechanism to force installing all extra dependencies with pip (like trytond_country[*]) so I hope we will remember when preparing the series.

Maybe it's worth to create an issue now and describe what packages should be installed. 

Otherwise I will try to remember also.
Author: [hidden] (ced) Tryton committer Tryton translator
Date: 2019-07-26.09:32:42
> As a side note: We ensure that the new dependencies are installed on the 5.4 docker images.

There is no mechanism to force installing all extra dependencies with pip (like trytond_country[*]) so I hope we will remember when preparing the series.
Author: [hidden] (pokoli) Tryton committer Tryton translator
Date: 2019-07-26.09:24:24
I've tested the patch and everything works as expected. So for me it's ready to push. 

As a side note: We ensure that the new dependencies are installed on the 5.4 docker images.
Author: [hidden] (ced) Tryton committer Tryton translator
Date: 2019-07-24.18:30:37
Author: [hidden] (pokoli) Tryton committer Tryton translator
Date: 2019-07-24.17:52:23
I tried to download the review but it's too large for download. Could you share it as patch file?
Author: [hidden] (ced) Tryton committer Tryton translator
Date: 2019-07-24.11:23:48
I would like to push this change before the end of the month so the translations will be cleaned from the country and currency strings.
Author: [hidden] (resteve)
Date: 2019-07-07.21:17:47
Mistake in msg50529. Replace country is in party.address.format, not in party.address. Sorry.
Author: [hidden] (resteve)
Date: 2019-07-07.21:14:12
IMHO relate country in party address is correct option because in reports you could browse data from the country (code, name...) and review285501002 you can't

Depends the country module is valid option.
Author: [hidden] (ced) Tryton committer Tryton translator
Date: 2019-07-07.19:54:49
Here is review285501002
For the symbol of currency as it is not provided by pycountry, I use forex-python. I think it is a good option as it may be the base for an automatic rate update.
Author: [hidden] (ced) Tryton committer Tryton translator
Date: 2019-06-05.16:28:45
The party module depends on the country data for the format. So if we do not load the countries, it fails to create those records. I propose to replace the Many2One country on party.address.format by a char field with the country code. This way, it does not depend on the country records.
Author: [hidden] (ced) Tryton committer Tryton translator
Date: 2019-05-13.11:04:28
It will be an intensive load and probably long process. I do not think it should be managed by a user request.
Also there is no point to run it again if the pycountry version did not change.
Author: [hidden] (pokoli) Tryton committer Tryton translator
Date: 2019-05-13.08:51:24
I'm wondering if it won't be better to use a wizard on the server instead of a script so the users can update their own data without requiring the intervention of the system administrator.
Author: [hidden] (ced) Tryton committer Tryton translator
Date: 2019-05-10.19:24:14
Managing those data inside the XML is quiet painful.
Instead I think we should use a script a little bit like the trytond_import_zip but using pycountry.

The script could manage the update using the ISO code as ID.

As it can be slow and not everybody needs every countries or currencies. I think the scripts could take as argument a list of ISO code to create/update.
History
Date User Action Args
2019-07-30 23:30:42roundup-botsetmessages: + msg50978
2019-07-30 23:30:38roundup-botsetmessages: + msg50977
2019-07-30 23:03:14roundup-botsetmessages: + msg50975
2019-07-30 23:03:10roundup-botsetmessages: + msg50974
2019-07-30 23:03:06roundup-botsetmessages: + msg50973
2019-07-30 23:03:01roundup-botsetstatus: testing -> resolved
nosy: + roundup-bot
messages: + msg50972
2019-07-26 09:46:17pokolisetmessages: + msg50906
2019-07-26 09:32:43cedsetmessages: + msg50898
2019-07-26 09:24:24pokolisetmessages: + msg50897
2019-07-24 18:30:37cedsetmessages: + msg50852
2019-07-24 17:52:23pokolisetmessages: + msg50848
2019-07-24 11:23:48cedsetmessages: + msg50829
2019-07-12 21:06:21reviewbotsetmessages: + msg50638
2019-07-07 21:17:48restevesetmessages: + msg50530
2019-07-07 21:14:13restevesetmessages: + msg50529
2019-07-07 20:08:51reviewbotsetnosy: + reviewbot
messages: + msg50528
2019-07-07 19:54:50cedsetstatus: in-progress -> testing
reviews: 285501002
messages: + msg50527
keyword: + review
2019-06-05 16:28:45cedsetmessages: + msg50069
component: + party
2019-06-05 10:17:55cedsetstatus: chatting -> in-progress
assignedto: ced
2019-05-13 12:09:21restevesetnosy: + resteve
2019-05-13 11:04:28cedsetmessages: + msg49709
2019-05-13 08:51:25pokolisetstatus: unread -> chatting
nosy: + pokoli
messages: + msg49707
2019-05-10 19:25:25cedlinkissue8344 superseder
2019-05-10 19:24:37cedlinkissue8345 superseder
2019-05-10 19:24:14cedcreate