Перейти к содержимому
Меню
Чтобы взаимодействовать с сообществом, необходимо зарегистрироваться.
Этот вопрос был отмечен
2 Ответы
9489 Представления

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

Аватар
Отменить
Related Posts Ответы Просмотры Активность
2
февр. 24
4012
0
янв. 23
1495
4
апр. 19
12898
1
янв. 25
1072
1
сент. 24
3017