Skip to Content
Menu
This question has been flagged
4 Replies
3403 Views


I am having trouble accessing the "Product" from the "master data" drop down menu in the Inventory app. When I click it, it gives me the following error. I know that people have had similar incidents but I couldn't find a case where the "view" line (second line from last) is unlivable. Any suggestions ? Thanks in advance


Code:

Error: 
Odoo Server Error 

Traceback (most recent call last): 
File "C:\Program Files (x86)\Odoo 12.0\server\odoo\http.py", line 656, in _handle_exception 
return super(JsonRequest, self)._handle_exception(exception) 
File "C:\Program Files (x86)\Odoo 12.0\server\odoo\http.py", line 314, in _handle_exception 
raise pycompat.reraise(type(exception), exception, sys.exc_info()[2]) 
File "C:\Program Files (x86)\Odoo 12.0\server\odoo\tools\pycompat.py", line 87, in reraise 
raise value 
File "C:\Program Files (x86)\Odoo 12.0\server\odoo\http.py", line 698, in dispatch 
result = self._call_function(**self.params) 
File "C:\Program Files (x86)\Odoo 12.0\server\odoo\http.py", line 346, in _call_function 
return checked_call(self.db, *args, **kwargs) 
File "C:\Program Files (x86)\Odoo 12.0\server\odoo\service\model.py", line 97, in wrapper 
return f(dbname, *args, **kwargs) 
File "C:\Program Files (x86)\Odoo 12.0\server\odoo\http.py", line 339, in checked_call 
result = self.endpoint(*a, **kw) 
File "C:\Program Files (x86)\Odoo 12.0\server\odoo\http.py", line 941, in __call__ 
return self.method(*args, **kw) 
File "C:\Program Files (x86)\Odoo 12.0\server\odoo\http.py", line 519, in response_wrap 
response = f(*args, **kw) 
File "c:\program files (x86)\odoo 12.0\server\odoo\addons\web\controllers\main.py", line 962, in call_kw 
return self._call_kw(model, method, args, kwargs) 
File "c:\program files (x86)\odoo 12.0\server\odoo\addons\web\controllers\main.py", line 954, in _call_kw 
return call_kw(request.env[model], method, args, kwargs) 
File "C:\Program Files (x86)\Odoo 12.0\server\odoo\api.py", line 745, in call_kw 
return _call_kw_model(method, model, args, kwargs) 
File "C:\Program Files (x86)\Odoo 12.0\server\odoo\api.py", line 718, in _call_kw_model 
result = method(recs, *args, **kwargs) 
File "C:\Program Files (x86)\Odoo 12.0\server\odoo\models.py", line 1376, in load_views 
for [v_id, v_type] in views 
File "C:\Program Files (x86)\Odoo 12.0\server\odoo\models.py", line 1376, in <dictcomp> 
for [v_id, v_type] in views 
File "c:\program files (x86)\odoo 12.0\server\odoo\addons\mail\models\mail_thread.py", line 410, in fields_view_get 
res = super(MailThread, self).fields_view_get(view_id=view_id, view_type=view_type, toolbar=toolbar, submenu=submenu) 
File "C:\Program Files (x86)\Odoo 12.0\server\odoo\models.py", line 1462, in fields_view_get 
xarch, xfields = View.postprocess_and_fields(self._name, etree.fromstring(result['arch']), view_id) 
File "c:\program files (x86)\odoo 12.0\server\odoo\addons\base\models\ir_ui_view.py", line 1096, in postprocess_and_fields 
self.raise_view_error(message, view_id) 
File "c:\program files (x86)\odoo 12.0\server\odoo\addons\base\models\ir_ui_view.py", line 548, in raise_view_error 
raise ValueError(message) 
ValueError: Field `service_to_purchase` does not exist 

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

Avatar
Discard
Best Answer

Just reinstall sale_purchase module

Avatar
Discard
Author Best Answer

Hi,

Just wanted to thank  both Alex and Niyas for answering my question. Unfortunately I can't reply to your individual comments because my Karma is too low, so this will do. I took your recommendations but I couldn't find the view in the the settings. I know that my custom module doesn't have this field either. I ended up uninstalling ALL the module and then reinstalling, which solved the problem. I was wondering if you guys had any ideas? In the future I will have information in the modules so it wouldn't be ideal for me to uninstall all the modules. At any rate I appreciate you guys taking the time to help me with my questions. 

Avatar
Discard
Best Answer

Hi.

As described in the other answer by Alex, in the corresponding view, there is a field which is used in the views but the same is not defined in the corresponding model. To fix this issue, what you have to do is that, either, 

1. Define the field in the corresponding model

2. Remove the usage of the field from the View.


For adding the field to the model, either you can do it from the code or from the Ui. For deleting the usage of this field from the views.activate the developer mode and navigate to Settings -> Technical -> User Interface -> Views, and search for the view contains service_to_purchase .  

For finding the view containing this field, see this answer too:  How can I retrieve all views using a particular field of a model?

Thanks

Avatar
Discard
Best Answer

It looks like you may have a customization that has not been applied to your database. You need to either apply the customization to your database or delete the field from your view. To delete the field from your view, enter debug mode and then on the home screen type "views". Find the view that works with this module and delete the service_to_purchase field.

It is also possible that you have removed the view from the product menu item. If that is the case you should edit the menu item and re-assign the view to action. This can be done by going to debug mode, clicking the bug in the top right, and then clicking "edit action".

Avatar
Discard