So I want to delete a field from my module? Should I do it manually deleting it from my database? Or there is another way. Thank you.
Tryton will not delete fields from the database in order to avoid data loss.
Once you have removed the ModelSQL class attribute that created the field, update your module (using trytond-admin -u MODULE or in Administration/Modules) and then drop the column(s) manually using sqlite/psql, while making sure that you are not losing data.
In the case of migration it is possible to do by code, so I guess it depends on your case.
Here is an example: modules/party/address.py · branch/default · Tryton / Tryton · GitLab
Btw, I found the example by doing: cd tryton/modules; grep -ri drop .
When you said
“update your module using sqlite/psql”
do you mean when I do trytond-admin
? It will create all the field i created in model?
Yes but it may also remove column if you call TableHandler.drop_column
for your field in the Model.__register__
.
But this means that the data in it will be lost.
BTW, I did not write that.
The database may be updated using trytond-admin or by the interface at Administration/Modules.
I would say that you may modify your database manually using sqlite/psql.