Search in warehouse error

Hello. Good morning everyone.
I can’t fix the following error that appears when entering stock/Locations.
Tryton does not perform the search when selecting a warehouse in either lots or products selection.

Traceback (most recent call last):
  File "/trytond/", line 117, in dispatch_request
    return endpoint(request, **request.view_args)
  File "/trytond/protocols/", line 47, in rpc
    request, database_name, *request.rpc_params)
  File "/trytond/", line 84, in auth_required
    return wrapped(*args, **kwargs)
  File "/trytond/protocols/", line 159, in wrapper
    return func(request, pool, *args, **kwargs)
  File "/trytond/protocols/", line 180, in _dispatch
    result = rpc.result(meth(*c_args, **c_kwargs))
  File "/trytond/model/", line 1353, in search
  File "/trytond/backend/postgresql/", line 74, in execute
    cursor.execute(self, sql, args)
psycopg2.ProgrammingError: can't adapt type 'Select'

Fault: can't adapt type 'Select'

Help, please… Thank you very much

I do not understand the step to follow to reproduce.

It seems that a python-sql Select object is passed as parameter in the query.
So looking at the generated query should be insightful.

Hello, I share a screen print of the step where the error occurs.

Thank you very much

Can not reproduce on demo server.

I’ve been looking for a possible solution for two weeks but I can’t find the error.
any ideas?

Maybe you do not have a recent enough python-sql library. I’m thinking about Support Select queries in conditionals and functions (#73) · Issues · Tryton / python-sql · GitLab