Skip to Content
Menu
You need to be registered to interact with the community.
This question has been flagged
2 Odgovori
9467 Prikazi

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
Opusti
Best Answer

Hi,

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


Regards

Avatar
Opusti
Best Answer

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
Opusti
Related Posts Odgovori Prikazi Aktivnost
2
feb. 24
3996
0
jan. 23
1493
4
apr. 19
12890
1
jan. 25
1062
1
sep. 24
3003