Skip to Content
Menu
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
To pytanie dostało ostrzeżenie
2 Odpowiedzi
8131 Widoki

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?

Awatar
Odrzuć
Najlepsza odpowiedź

Hi,

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


Regards

Awatar
Odrzuć
Najlepsza odpowiedź

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

Awatar
Odrzuć
Powiązane posty Odpowiedzi Widoki Czynność
2
lut 24
3244
0
sty 23
1282
4
kwi 19
12545
1
sty 25
597
1
wrz 24
2465