Home > Blockchain >  Using Odoo External API, is it possible to filter by a field that is equal to array of values?
Using Odoo External API, is it possible to filter by a field that is equal to array of values?

Time:09-06

I know how to filter by value, but I don't know how to filter by array of values (the field contains an array).
I use Odoo 15.0 and XML-RPC to get external access to its database.
In enter image description here

But I need to filter by pricelist_id equals [2, Catalogue Price (CAD)], which is String representation of Object[]. The value is an array itself, and here I'm stuck.
I tried different variants of filter syntax but none of them worked.

asList("pricelist_id", "=", asList(2, "Catalogue Price (CAD)")) 
// or
asList("pricelist_id", "=", new Object[] {2, "Catalogue Price (CAD)"}) 

give

psycopg2.errors.InvalidTextRepresentation: invalid input syntax for type integer: "

  • Related