跳至内容
菜单
此问题已终结
2 回复
9484 查看

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?

形象
丢弃
最佳答案

Hi,

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


Regards

形象
丢弃
最佳答案

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

形象
丢弃
相关帖文 回复 查看 活动
2
2月 24
4004
0
1月 23
1495
4
4月 19
12896
1
1月 25
1071
1
9月 24
3015