Domain conversion - handle list of values passed via rpc
I hope I describe my problem correctly:
I have ported the domain/query handler in https://foss.heptapod.net/tryton/tryton/-/blob/branch/default/sao/src/common.js to Typescript for a project in order to make it really reusable - also in node environments without a browser.
In doing so, I encountered the following problem:
If, for example, you search for a list of ids
`['OR', ['student.id', 'in', [1]], ['name', 'ilike', '%hans%']]`
the part
`[1]`
as it is received as list (there is no tuple in javascript) in
modelstorage.py / _search_domain_active
is converted to:
```
['student.id', 'in', [1]]
_search input ['student.id', 'in', [1]]
_search output ['student.id', 'in', ['AND', 1]]
after ['student.id', 'in', ['AND', 1]]
before [('id', 'in', ['AND', 1]]
_search input [('id', 'in', ['AND', 1])]
_search output ['AND', ('id', 'in', ['AND', 1])]
after ['AND', ('id', 'in', ['AND', 1])]
```
possible solution:
```
@classmethod
def _search_domain_active(cls, domain, active_test=True):
if len(domain) == 3 and domain[1] in ['in', 'not in'] \
and isinstance(domain[2], list):
domain[2] = tuple(domain[2])
```
<snip>
but I don't know if there is another way.
issue