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

in odoo 15,
 request.env['product.product'].sudo().search_read([('id','=', search_id)]), used to give all the fields. 
seems like its not the same for 17. 
How can i read all the fields in odoo17 orm. 
What do i use ? search, search_read? Most importantly, how to do i get all the data?

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

Hi,

You can try this code , request.env['product.product'].search_read([], ['id'])


Regards

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

Hi junaid 

you can get 

 request.env['product.product'].search_read([])

or you can find specific field using like 

request.env['product.product'].search_read([],['name','id'])


Thanks

อวตาร
ละทิ้ง
Related Posts ตอบกลับ มุมมอง กิจกรรม
2
ก.พ. 24
3976
0
ม.ค. 23
1492
Advanced Search: How to remove fields? แก้ไขแล้ว
4
เม.ย. 19
12884
1
ม.ค. 25
1057
1
ก.ย. 24
2994