Skip to Content
Menu
This question has been flagged
2 Replies
2310 Views

When I'm trying to fetch the client details though the API i get an error. I updated the base of Odoo to the newest files. Running Odoo 16 on a windows platform:

Traceback (most recent call last): File "F:\Odoo\server\odoo\addons\base\controllers\rpc.py", line 150, in xmlrpc_2 response = self._xmlrpc(service) File "F:\Odoo\server\odoo\addons\base\controllers\rpc.py", line 130, in _xmlrpc result = dispatch_rpc(service, method, params) File "F:\Odoo\server\odoo\http.py", line 366, in dispatch_rpc return dispatch(method, params) File "F:\Odoo\server\odoo\service\model.py", line 35, in dispatch res = execute(db, uid, *params[3:]) File "F:\Odoo\server\odoo\service\model.py", line 65, in execute res = execute_cr(cr, uid, obj, method, *args, **kw) File "F:\Odoo\server\odoo\service\model.py", line 50, in execute_cr result = retrying(partial(odoo.api.call_kw, recs, method, args, kw), env) File "F:\Odoo\server\odoo\service\model.py", line 133, in retrying result = func() File "F:\Odoo\server\odoo\api.py", line 457, in call_kw result = _call_kw_model(method, model, args, kwargs) File "F:\Odoo\server\odoo\api.py", line 430, in _call_kw_model result = method(recs, *args, **kwargs) File "F:\Odoo\server\odoo\models.py", line 1512, in search res = self._search(domain, offset=offset, limit=limit, order=order, count=count) File "F:\Odoo\server\odoo\addons\base\models\res_partner.py", line 911, in _search return super(Partner, self)._search(args, offset=offset, limit=limit, order=order, File "F:\Odoo\server\odoo\models.py", line 4655, in _search if expression.is_false(self, domain): File "F:\Odoo\server\odoo\osv\expression.py", line 226, in is_false elif token[1] == 'in' and not (isinstance(token[2], Query) or token[2]): IndexError: string index out of range


Does anyone have an idea what is going wrong?
Thanks in advance

Avatar
Discard

Hi,
Please add relevant part of written api along with the question.
thanks

Author

Hi Mehjabin,


I'm using a external party for controlling the API functions (apicenter.io). The only code i get to see is:


{"Exception":{"fault":{"value":{"struct":{"member":[{"name":"faultCode","value":{"int":"1"}},{"name":"faultString","value":{"string":"Traceback (most recent call last): File "F:\Odoo\server\odoo\addons\base\controllers\rpc.py", line 150, in xmlrpc_2 response = self._xmlrpc(service) File "F:\Odoo\server\odoo\addons\base\controllers\rpc.py", line 130, in _xmlrpc result = dispatch_rpc(service, method, params) File "F:\Odoo\server\odoo\http.py", line 366, in dispatch_rpc return dispatch(method, params) File "F:\Odoo\server\odoo\service\model.py", line 35, in dispatch res = execute(db, uid, *params[3:]) File "F:\Odoo\server\odoo\service\model.py", line 65, in execute res = execute_cr(cr, uid, obj, method, *args, **kw) File "F:\Odoo\server\odoo\service\model.py", line 50, in execute_cr result = retrying(partial(odoo.api.call_kw, recs, method, args, kw), env) File "F:\Odoo\server\odoo\service\model.py", line 133, in retrying result = func() File "F:\Odoo\server\odoo\api.py", line 457, in call_kw result = _call_kw_model(method, model, args, kwargs) File "F:\Odoo\server\odoo\api.py", line 430, in _call_kw_model result = method(recs, *args, **kwargs) File "F:\Odoo\server\odoo\models.py", line 1512, in search res = self._search(domain, offset=offset, limit=limit, order=order, count=count) File "F:\Odoo\server\odoo\addons\base\models\res_partner.py", line 911, in _search return super(Partner, self)._search(args, offset=offset, limit=limit, order=order, File "F:\Odoo\server\odoo\models.py", line 4655, in _search if expression.is_false(self, domain): File "F:\Odoo\server\odoo\osv\expression.py", line 226, in is_false elif token[1] == 'in' and not (isinstance(token[2], Query) or token[2]): IndexError: string index out of range "}}]}}}},"data":{"startTag":"methodCall","methodName":"execute","params":{"param":[{"value":{"string":"MYDATABASE"}},{"value":{"int":2}},{"value":{"string":"MYPASSWORD"}},{"value":{"string":"res.partner"}},{"value":{"string":"search"}},{"value":{"array":{"data":{"value":[]}}}},{"offset":{"value":{"int":0}},"limit":{"value":{"int":10}}}]}}}


Best Answer

you can take to diagnose and resolve this issue:

  1. Check the Domain Expression:

    • Review the code where you are constructing the domain for the search operation. Look for any places where you might be using the "in" operator incorrectly or passing incorrect data types in the domain.
  2. Examine the Data:

    • Check the data in your Odoo database, specifically the records related to the search operation. Ensure that there are no data inconsistencies or unexpected values that could be causing this error.

Review Custom Code:

  • If you have any custom code or modules that modify the behavior of Odoo's search operations, review them carefully. Check for any custom domain expressions that might be causing the issue.


Avatar
Discard
Best Answer

Hi,

The error message you provided indicates an issue with the search operation on the res.partner model in Odoo. Specifically, it seems to be related to a problem with the domain expression. Check the domain expression you're using in your API request. And also check If you have any custom code or modules that interact with the res.partner model, review them to see if there might be any logic or expressions causing the issue.

It may helps you

Avatar
Discard
Related Posts Replies Views Activity
1
Sep 23
1806
3
Apr 19
2949
5
May 25
32675
0
Dec 24
950
1
Mar 23
1840