Siirry sisältöön
Menu
Sinun on rekisteröidyttävä, jotta voit olla vuorovaikutuksessa yhteisön kanssa.
Tämä kysymys on merkitty
2 Vastaukset
9515 Näkymät

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
Hylkää
Paras vastaus

Hi,

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


Regards

Avatar
Hylkää
Paras vastaus

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
Hylkää
Aiheeseen liittyviä artikkeleita Vastaukset Näkymät Toimenpide
2
helmik. 24
4029
0
tammik. 23
1501
4
huhtik. 19
12904
1
tammik. 25
1083
1
syysk. 24
3035