콘텐츠로 건너뛰기
메뉴
커뮤니티에 참여하려면 회원 가입을 하시기 바랍니다.
신고된 질문입니다
2 답글
6306 화면

I try to invoke a json-rpc api call in Postman, everything works well, but I dont know how to pass the pagination params (offset, limit):
I try this raw JSON:

----------------------------------------------------
{
"jsonrpc": "2.0",
"method": "call",
"params": {
"service": "object",
"method": "execute",
"args": [
  "user",
  2,
  "token",
  "stock.move",
  "search_read",
  [
    ["product_id", "in", [3642]],
    ["state", "not in", ["draft", "cancel"]]
  ],
  {"limit": 1}     

 ]
},
"id": 1
}
----------------------------------------------------
but get the error:
"Invalid field 'limit' on model 'stock.move'"
The question is: How to pass offset and limit params in raw JSON query?

아바타
취소
작성자 베스트 답변

  Two years have passed 
  This doesn't work: {"limit": 10, "offset": 0}
  I`ve already found out a working solution 2y ago:

----------- --------------------------------------- --
{
"jsonrpc": "2.0",
"method": "call",
"params": {
"service": "object",
"method": "execute",
"args": [
  "user",
  2 ,
  "token",
  "stock.move",
  "search_read",
  [
    ["product_id", "in", [3642]],
    ["state", "not in", ["draft", "cancel"]]
  ],
  [], -- Here go fields of object to retrieve

  0, 100 --  And here are two separate params offset & limit

 ]
},
"id": 1
}
----------------------------------------- -----------





아바타
취소
베스트 답변
try this way:{
"jsonrpc": "2.0",
"method": "call",
"params": {
"service": "object",
"method": "execute",
"args": [
"user",
2,
"token",
"stock.move",
"search_read",
[
["product_id", "in", [3642]],
["state", "not in", ["draft", "cancel"]]
],
{},
{"limit": 10, "offset": 0}
]
},
"id": 1
}

아바타
취소
관련 게시물 답글 화면 활동
0
3월 15
5789
2
7월 25
297
1
6월 25
1906
1
7월 25
892
1
4월 25
1548