So i was trying to create a module which will be having more than 12000 hsn code by default
am not sure how i could put the default data in database when module is activated ?
so this module will be having code and description field
any headsup with this is much appreciated
nicoe
(Nicolas Évrard)
June 5, 2021, 8:34am
2
In Tryton we don’t provide data in the modules, we prefer the approach of having a script that will populate the database.
See for example: modules/country: 3a7bb69289ce scripts/import_countries.py
Thanks for the reply … does this script runs automatically when we activates the modules ?
nicoe
(Nicolas Évrard)
June 5, 2021, 8:48am
4
No but you can run it whenever you want if the data change without having to release a new version of the module.
You could make running the script part of your deployment routine if necessary.
ced
(Cédric Krier)
June 5, 2021, 12:04pm
5
Indeed it depends of the kind of data if it changes frequently, if it can customized etc. In some cases it may make sense to put data in XML like for the chart of accounts.
system
(system)
Closed
July 5, 2021, 12:04pm
6
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.