Skip ke Konten
Menu
Pertanyaan ini telah diberikan tanda
2 Replies
9479 Tampilan

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?

Avatar
Buang
Jawaban Terbai

Hi,

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


Regards

Avatar
Buang
Jawaban Terbai

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

Avatar
Buang
Post Terkait Replies Tampilan Aktivitas
2
Feb 24
4000
0
Jan 23
1495
4
Apr 19
12896
1
Jan 25
1068
1
Sep 24
3015