Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
2 Trả lời
9546 Lượt xem

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?

Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

Hi,

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


Regards

Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhấ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

Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
2
thg 2 24
4066
0
thg 1 23
1505
4
thg 4 19
12910
1
thg 1 25
1101
1
thg 9 24
3062