تخطي للذهاب إلى المحتوى
القائمة
لقد تم الإبلاغ عن هذا السؤال
2 الردود
9437 أدوات العرض

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
فبراير 24
3954
0
يناير 23
1492
4
أبريل 19
12884
1
يناير 25
1048
1
سبتمبر 24
2978