Přejít na obsah
Menu
You need to be registered to interact with the community.
This question has been flagged
2 Odpovědi
9452 Zobrazení

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
Zrušit
Nejlepší odpověď

Hi,

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


Regards

Avatar
Zrušit
Nejlepší odpověď

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
Zrušit
Related Posts Odpovědi Zobrazení Aktivita
2
úno 24
3971
0
led 23
1492
4
dub 19
12884
1
led 25
1057
1
zář 24
2993