Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
3 ตอบกลับ
7017 มุมมอง

Hi, I noticed that the API search_read method can't return more than 100 records, can you confirm that? Is it possibile to avoid that?

Thank you in advance.

อวตาร
ละทิ้ง
ผู้เขียน คำตอบที่ดีที่สุด

Thank you very much

อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

HI

The search_read method of the XML-RPC API is used to search and read records from the database. By default, this method returns a maximum of 100 records, to prevent overloading the system with too many records.

However, this limit can be overridden by passing the limit parameter to the method with the desired number of records to return. For example, to return 200 records, you would call the method like this: 

search_read(model, domain, fields, offset=0, limit=200)

อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

Hi,

The default limit for the search read method in the Odoo API is 100 records.
However, by passing the limit argument in the method's options, you can define a higher limit.

For instance, you would execute search read(limit=500) to get up to 500 records.

Additionally, you can use the offset parameter to specify a starting point for the records. The offset parameter can be used in conjunction with the limit parameter to retrieve large amounts of data.

For example, you would execute a search read(limit=100,offset=100) to return records from 100 to 200.

Regards

อวตาร
ละทิ้ง
Related Posts ตอบกลับ มุมมอง กิจกรรม
1
มี.ค. 22
5077
1
ก.พ. 22
5225
1
ก.ค. 20
9069
1
ม.ค. 24
3251
0
ก.ย. 23
27