I created a field in the model and its view, tested it and it worked. Then later deleted it, including in the database. When I created another field and restarted the system, it's generating an error saying the field I deleted perviously was referenced somewhere when I'm very sure it has been removed completely. I think the system is storing the cache information somewhere and I really don't know how to get rid of it.
1 Answer 1
Most probably, this is caused by the field is still registered
in the table of ir_model_fields.
You need to check that table and manually delete your custom field from there.
These are the ways to do that:
- Get into the database, either by using psql through terminal, or PGAdmin software, or Query Deluxe (an Odoo module made by Yvan Dotet where you can access sql from inside Odoo db by query)
- No matter which method you use from first step above, then you need to start checking the 'ir_model' first, in which model you put your custom field (
select * from ir_model where name = 'model_name';) where'model_name'is the technical name of the model of your custom field - After you get the id of the model, then do the query to check from
ir_model_fields(select * from ir_model_fields where model_id = 'model_id';) then use the query to delete your custom field (delete from ir_model_fields where model_id = 'model_id' and name = 'field_name';)
Finally, don't forget to restart your Odoo service, upgrade the module where the model resides in, and do logout-login from the corresponding database.
That's all for you now, hope it helps!
References: