Skip to Content
Menu
This question has been flagged
1 Reply
933 Views

I would like to formulate a jsonRPC request with which i can read multiple products in one request and i'm having some issues.
My single part request works:
{ "jsonrpc": "2.0",

"method": "call",

"params": {

"service": "object",

"method": "execute_kw",

"args": [

"mydb", 1,

"mypassword",

"product.product",

"search_read",

[[["default_code", "ilike", "XXX1"]]],

{"fields": ["id", "default_code", "barcode", "name"],"limit": 80}

]

},

"id": 3

}
Looking at the documentation am not quite sure on how to formulate a request for multiple parts.
I want the result to return items "XXX1","XXX2"
What would my jsaonRPC request look like to achive this?


Avatar
Discard
Author Best Answer

OK so i can change the line:
[[["default_code", "ilike", "XXX1"]]],
to 
[["|",["default_code", "ilike", "XXX1"],["default_code", "ilike", "XXX2"]]],
That allows for 2 parts.
I am still stook though for 3 + parts:
I tried the following, none of which worked.
Test1:
[["|",["default_code", "ilike", "XXX1"],["default_code", "ilike", "XXX2"],["default_code", "ilike", "XXX3"]]]
Test2:
[["|",["default_code", "ilike", "XXX1"],["|",["default_code", "ilike", "XXX2"],["default_code", "ilike", "XXX3"]]]]
Test3: 

[["|",["|",["default_code", "ilike", "XXX1"],["default_code", "ilike", "XXX2"]],["default_code", "ilike", "XXX3"]]]
any help would be greatly appreciated.

Avatar
Discard
Related Posts Replies Views Activity
1
Apr 25
590
1
Mar 25
772
3
Feb 25
1103
1
Dec 24
1206
2
Sep 24
763