Skip to main content

Error code: Error while retrieving: Odoo API Error (BaseModel.search() takes from 2 to 5 positional arguments but 6 were given): Traceback (most recent call last): File "/odoo/odoo-server/odoo/addons/base/controllers/rpc.py", line 151, in xmlrpc_1 response = self._xmlrpc(service) ^^^^^^^^^^^^^^^^^^^^^ File "/odoo/odoo-server/odoo/addons/base/controllers/rpc.py", line 139, in _xmlrpc result = dispatch_rpc(service, method, params) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/odoo/odoo-server/odoo/http.py", line 398, in dispatch_rpc return dispatch(method, params) ^^^^^^^^^^^^^^^^^^^^^^^^ File "/odoo/odoo-server/odoo/service/model.py", line 56, in dispatch res = execute(db, uid, *params[3:]) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/odoo/odoo-server/odoo/service/model.py", line 87, in execute res = execute_cr(cr, uid, obj, method, *args, **kw) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/odoo/odoo-server/odoo/service/model.py", line 72, in execute_cr result = retrying(partial(odoo.api.call_kw, recs, method, args, kw), env) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/odoo/odoo-server/odoo/service/model.py", line 156, in retrying result = func() ^^^^^^ File "/odoo/odoo-server/odoo/api.py", line 533, in call_kw result = getattr(recs, name)(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ TypeError: BaseModel.search() takes from 2 to 5 positional arguments but 6 were given

Here’s the screenshot


Hey there ​@njj1986 👋

Looks like you’ve already posted about this over here: 

As I mentioned in my reply there I’ve added you to the bug that’s linked to these errors, so we’ll be in touch as soon as it’s sorted. In case it’s helpful, here’s the workaround shared on the main topic that may help to prevent the errors in the meantime:

Simplest way to fix this problem is edit /opt/odoo17/odoo/models.py

on line 1600 need to found the line:

    def search(self, domain, offset=0, limit=None, order=None):

and replace with 

    def search(self, domain, offset=0, limit=None, order=None, anything=None):

 

the problem:

Zapier sending request with wrong amount of parameters.

As we’ve already got one topic discussing the bug I’ll need to close this one out as well. For anyone that comes across this and wanted to be added to the bug report please reach out on the main topic here and we’ll get that sorted. 🙂