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

Hello, currently i am working on odoo project management system in which on edit project i am getting below error.

Traceback (most recent call last):
  File "/home/priyankspaththa/Desktop/Odoo15_crm/py_crm/odoo/addons/base/models/ir_http.py", line 237, in _dispatch
    result = request.dispatch()
  File "/home/priyankspaththa/Desktop/Odoo15_crm/py_crm/odoo/http.py", line 687, in dispatch
    result = self._call_function(**self.params)
  File "/home/priyankspaththa/Desktop/Odoo15_crm/py_crm/odoo/http.py", line 359, in _call_function
    return checked_call(self.db, *args, **kwargs)
  File "/home/priyankspaththa/Desktop/Odoo15_crm/py_crm/odoo/service/model.py", line 94, in wrapper
    return f(dbname, *args, **kwargs)
  File "/home/priyankspaththa/Desktop/Odoo15_crm/py_crm/odoo/http.py", line 348, in checked_call
    result = self.endpoint(*a, **kw)
  File "/home/priyankspaththa/Desktop/Odoo15_crm/py_crm/odoo/http.py", line 916, in __call__
    return self.method(*args, **kw)
  File "/home/priyankspaththa/Desktop/Odoo15_crm/py_crm/odoo/http.py", line 535, in response_wrap
    response = f(*args, **kw)
  File "/home/priyankspaththa/Desktop/Odoo15_crm/py_crm/addons/web/controllers/main.py", line 1343, in call_kw
    return self._call_kw(model, method, args, kwargs)
  File "/home/priyankspaththa/Desktop/Odoo15_crm/py_crm/addons/web/controllers/main.py", line 1335, in _call_kw
    return call_kw(request.env[model], method, args, kwargs)
  File "/home/priyankspaththa/Desktop/Odoo15_crm/py_crm/odoo/api.py", line 464, in call_kw
    result = _call_kw_multi(method, model, args, kwargs)
  File "/home/priyankspaththa/Desktop/Odoo15_crm/py_crm/odoo/api.py", line 451, in _call_kw_multi
    result = method(recs, *args, **kwargs)
  File "/home/priyankspaththa/Desktop/Odoo15_crm/py_crm/odoo/models.py", line 3225, in read
    self._read(stored_fields)
  File "/home/priyankspaththa/Desktop/Odoo15_crm/py_crm/odoo/models.py", line 3371, in _read
    field.read(fetched)
  File "/home/priyankspaththa/Desktop/Odoo15_crm/py_crm/odoo/fields.py", line 3768, in read
    order_by = comodel._generate_order_by(None, wquery)
  File "/home/priyankspaththa/Desktop/Odoo15_crm/py_crm/odoo/models.py", line 4597, in _generate_order_by
    order_by_elements = self._generate_order_by_inner(self._table, order_spec, query)
  File "/home/priyankspaththa/Desktop/Odoo15_crm/py_crm/odoo/models.py", line 4563, in _generate_order_by_inner
    raise ValueError("Invalid field %r on model %r" % (order_field, self._name))
Exception

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/home/priyankspaththa/Desktop/Odoo15_crm/py_crm/odoo/http.py", line 643, in _handle_exception
    return super(JsonRequest, self)._handle_exception(exception)
  File "/home/priyankspaththa/Desktop/Odoo15_crm/py_crm/odoo/http.py", line 301, in _handle_exception
    raise exception.with_traceback(None) from new_cause
ValueError: Invalid field 'id' on model '_unknown'


Avatar
Discard

Hi

Please make sure the dependency of modules is added correctly. Did you miss any dependency of modules of the many2one fields in your custom module?

Best Answer

Hi,

Looking at the trace back the exception is raised from the module py_crm, which is third party module.

Please cross checked the code of py_crm module and see from which part of the code, the error is raised.


Tip: See if there is any many2one fields without co models set.


Thanks & Regards

Walnut Software Solutions

Avatar
Discard
Author

Hello py_crm is my folder name it is not a custom module. in py_crm folder i have addons and custome addons