This question has been flagged
2 Replies
2428 Views

When trying to access a list of a module (with existing records that i imported from another odoo server) I didn't develop i'm getting:

File "/opt/bitnami/apps/odoo/lib/odoo-13.0.post20200815-py3.7.egg/odoo/addons/base/models/ir_ui_view.py", line 614, in raise_view_error raise ValueError(message) ValueError: Field `x_y` does not exist 

Error Context: View `n/a`
[view_id: n/a, xml_id: n/a, model: n/a, parent_id: n/a]


My question is, how can I tackle this? since I didn't developed (the project seems abandoned by the author) it but have access to the code I was considering:


- Changing the view to not include the `x_y` field, I've done this, but don't know how to tell odoo to 'recompile' xml file. Not sure how I'd reload the module was I make these changes, I'm not a python dev but i've been reading that i may need to recompile all the addon?

- Reinstalling the module, I've also tried this but I get: `"could not serialize access due to concurrent update"`

- Updating models in the DB directly cause i think the addon is not taking into account when the `x_y` field is empty, so explicitly set it in the DB something like: `if model.x_y == null then model.x_y = '' (empty string)`


I'm not sure why this is giving an error cause on the former server the view could be accessed correctly, not sure if it is related to the former server been a normal Odoo installation and the later been a Bitnami installation, therefore some paths and configs been different. I think the mentioned addon is installed correctly because other views can be accessed correctly


I'm starting with odoo so i'm not sure if the approaches above are the ones to follow, I'd appreciate some guidance here, thanks



Avatar
Discard
Author Best Answer

Thanks for your help @Niyas Raphy. I've done the view steps you suggested and that solved it (now I am able to load the list view).

Since I've commented some fields (the problem was not only with just one field), they now obviously do not appear, the weird thing is the are defined in the model, like: 


`x_y = fields.Char(_("X Y"), compute='_compute_x_y')`,  so that leds me to think that `_compute_x_y(self)` function is not well defined, as it is not computing and setting a value for all records?

Thanks again!

Avatar
Discard
Author

Also there is a form view which has already some commented fields, and when I uncomment them, save and update the Addon, it reverts to been commented!. Is this some initial setup behaviour for that particular view, how can I really update the view? I have ssh access to the server and access to the DB, thanks :)

Best Answer

Hi,

The error is thrown when a field is used in xml views and when the same is not defined inside the corresponding model.

So here what you can do it that, if the database is accessible, activate the developer mode and navigate to Settings -> Technical -> User Interface -> Views, and search for you field inside the Architecture.




Then you will be getting the views containing this field, open and remove those field from these view, if it is not using or has to be removed.

Or find the models in which field is used in and add this field to corresponding modules and restart and upgrade the module. Also you can try upgrading modules from terminal, if the database is not accessible.

For Reference:

  1. How to Fix Field Does Not Exist Error Odoo

  2. How To Upgrade Module From Terminal in Odoo "

Thanks

Avatar
Discard