İçereği Atla
Menü
Bu soru işaretlendi
2 Cevaplar
9427 Görünümler

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
Vazgeç
En İyi Yanıt

Hi,

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


Regards

Avatar
Vazgeç
En İyi Yanıt

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
Vazgeç
İlgili Gönderiler Cevaplar Görünümler Aktivite
2
Şub 24
3950
0
Oca 23
1491
4
Nis 19
12882
1
Oca 25
1045
1
Eyl 24
2973