Tryton - Issues

 

Issue9446

Title Incorrect database uri used when running trytond_import_countries
Priority bug Status resolved
Superseder Nosy List ced, dave, reviewbot, roundup-bot
Type behavior Components country, currency, trytond
Assigned To ced Keywords review
Reviews 321741002
View: 321741002

Created on 2020-06-27.11:35:01 by dave, last changed by roundup-bot.

Messages
New changeset 03167e9c8ed1 by Cédric Krier in branch 'default':
Prevent import backend when importing module scripts
https://hg.tryton.org/tryton-env/rev/03167e9c8ed1
New changeset 93f83766e125 by Cédric Krier in branch 'default':
Prevent import backend when importing module scripts
https://hg.tryton.org/trytond/rev/93f83766e125
New changeset f8b76071b0e9 by Cédric Krier in branch 'default':
Prevent import backend when importing module scripts
https://hg.tryton.org/modules/currency/rev/f8b76071b0e9
New changeset 76b57faa75d9 by Cédric Krier in branch 'default':
Prevent import backend when importing module scripts
https://hg.tryton.org/modules/country/rev/76b57faa75d9
review321741002 updated at https://codereview.tryton.org/321741002/#ps295841002
msg58900 (view) Author: [hidden] (ced) (Tryton committer) (Tryton translator) Date: 2020-06-27.13:50:08
Here is review321741002 which delays the import of backend.
For the record, I tried other options:

- reload backend when configuration is updated but then many global variables are not reloaded (and could not)
- install scripts folders to a different module but it makes setup very complicated and break running from source
- I tried to put assert to ensure proper delay but other entrypoint like trytond-admin has different import path
msg58897 (view) Author: [hidden] (dave) (Tryton committer) Date: 2020-06-27.11:35:00
When the trytond_import_countries script is run the database uri specified in the config file is not used because the backend/__init__.py is imported before the configuration has been setup.  This issue may also apply to the other scripts.

See: https://discuss.tryton.org/t/proteus-and-trytond-import-countries-how-to-install/2937/16
History
Date User Action Args
2020-07-04 23:39:04roundup-botsetmessages: + msg58984
2020-07-04 23:38:58roundup-botsetmessages: + msg58983
2020-07-04 23:38:52roundup-botsetmessages: + msg58982
2020-07-04 23:38:47roundup-botsetstatus: testing -> resolved
nosy: + roundup-bot
messages: + msg58981
2020-06-27 13:55:11reviewbotsetnosy: + reviewbot
messages: + msg58901
2020-06-27 13:50:09cedsetstatus: in-progress -> testing
reviews: 321741002
messages: + msg58900
keyword: + review
2020-06-27 13:44:54cedsetstatus: unread -> in-progress
assignedto: ced
component: + currency
nosy: + ced
2020-06-27 11:35:01davecreate

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