Field does not exists on model error when upgrading custom modules in Odoo 16

In Odoo 16, I'm always facing the same problem with my custom modules. It occurs in random occassions when I'm adding a new field in a model, restarting the odoo service for python changes to take effect and then trying to upgrade the module in Apps.

When I press upgrade, I get an error that the field that I just added, does not exist in the model. The field does exist in the model and no matter what I do (restarting the odoo server again, refreshing the browser, double checked and copy pasted the field name in the xml) I get the same error when upgrading. The only solution is to change the name of the field. But this is not a proper solution because I have to change names of my variables and I don't want to.

What I described, doesn't always happen (e.g. as far as I've noticed, it doesn't happen when I create a new model. It only happens when I add more fields in the same model). Furthermore, I never faced the same problem with odoo 15 or 14.

Like there is some data cached somewhere and Odoo disregards the changes I make in my python files.

Has anyone else faced the same problem? Can I somehow clean odoo cache (if something like that exists).

I tried cleaning the browser's cache but it didn't fix anything. The problem seems to be browser independent ( I tried in both Chrome and Firefox).

Edit: Happened again. This time I have a live example Model where the field transfer_point_domain exists

Here is the view with the reference to the aforementioned field

Here is the error. I've already restarted odoo server and refreshed browser several times

I've already restarted odoo server and refreshed web browser several times...

Upvotes: 0

Views: 721

Answers (1)

Satish Prajapati
Satish Prajapati

Reputation: 75

Open odoo in incognito tab if it works

Upvotes: 0

Related Questions