Skip to Content
Menu
This question has been flagged
1 Reply
1527 Views

Hi there.


We're experiencing a strange behavior when adding fields to an existing model.


Say we add the field "field1" to the sale.order model via inheritance.

Then we add the field into the XML view.


We installed the module and It works as expected.


Now we add another field called "field2" with the same steps. Now when we upgrade the module, It throws an error like this: 

Field "field2" does not exist in model "repair.order"

We tried to restart the server, uninstall the module and install
the module again but no luck.


Now we made another odoo fresh installation, we installed the module and It Worked. 

"field1" and "field2" are properly rendered on sale.order view.


We don't understand why new changes are not applying.


Could someone help us with that?


PD: We tried in Odoo14 and Odoo15 but same result on both platforms.

Thank you in advance!



 

Avatar
Discard

Hi, if possible, share the piece of code for the custom field which has issue. Both python and xml codes.

Best Answer

Hi,

There are two possibilities that may cause this issue. Generally, this issue occurs because one forgets to add the second field in the py file. The next case happens while using the command line. We can update the app using the following command:"-c odoo.conf -u app_name". There is a possibility that if an incorrect app name is given then also this issue might occur.

Regards

Avatar
Discard