How is it possible to implement an "OR" search in JSON-2 API?
E.g. what value should "domain" have to implement "Name"="Bolt" OR "Name"="Table" for a product search? Where do I find the syntax documentation for this kind of needs?
This question has been flagged
1
Reply
217
Views
Hello Jarmo Palomaki,
I hope you are doing well
OR Search in Odoo JSON-RPC API
Use the | operator in prefix notation:
["|", ["name", "=", "Bolt"], ["name", "=", "Table"]]
I hope you are doing well
OR Search in Odoo JSON-RPC API
Use the | operator in prefix notation:
["|", ["name", "=", "Bolt"], ["name", "=", "Table"]]
Or simpler - use the in operator:
[["name", "in", ["Bolt", "Table"]]]
[["name", "in", ["Bolt", "Table"]]]
That's it. | goes before the two conditions, not between them.
I hope this information helps you
Thanks & Regards,
Kunjan Patel
Enjoying the discussion? Don't just read, join in!
Create an account today to enjoy exclusive features and engage with our awesome community!
Sign up| Related Posts | Replies | Views | Activity | |
|---|---|---|---|---|
|
|
3
Feb 26
|
2292 | ||
|
|
0
Dec 25
|
659 | ||
|
|
2
Mar 24
|
4667 | ||
|
|
0
Aug 21
|
4502 | ||
|
|
0
Jan 21
|
14218 |
Hello
I hope your issue is solved.
You can find here: https://www.odoo.com/documentation/19.0/developer/reference/external_api.html
Thanks.
Thanks. That has already helped. However, is there an answer for my second question? I.e. about the documentation?
That address does not display any documentation about the syntax of domain field value.
Additionally, in the end, there is an example using ids field.
What I am still missing is
However, the information I have alread got, has helped to solve the current issues.