Ir al contenido
Menú
Se marcó esta pregunta
2 Respuestas
9520 Vistas

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
Descartar
Mejor respuesta

Hi,

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


Regards

Avatar
Descartar
Mejor respuesta

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
Descartar
Publicaciones relacionadas Respuestas Vistas Actividad
2
feb 24
4043
0
ene 23
1501
4
abr 19
12904
1
ene 25
1091
1
sept 24
3040