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

Hello,

I am performing queries using xmlrpc and i am facing a counter intuitive behaviour :

I try to fetch all the products of my odoo db by doing something like that : 

models.execute_kw(db, uid, password,
'product.product', 'search',
[[]])
and i notice that this query filter out products whose field "active" is set to false.
To retrieve all the products, i have to do something like this : 

models.execute_kw(db, uid, password,
'product.product', 'search',
[[["active", "in", [True, False]]]])


Is this implicit filtering normal ? Where is it documented ? Is there other implicit filterings that i should know about ?


Thanks

الصورة الرمزية
إهمال
أفضل إجابة

Hi,

By default the odoo orm methods return the active records only. In order to get all the records without considering active is True or False, you have to explicitly pass the condition in along with search or pass active_test False in the context.

You can see details here in the odoo documentation: https://www.odoo.com/documentation/14.0/developer/reference/orm.html#

Odoo ORM: https://www.youtube.com/watch?v=8V-uOG8KkKA

Thanks

الصورة الرمزية
إهمال
المنشورات ذات الصلة الردود أدوات العرض النشاط
0
يونيو 21
4559
0
أغسطس 18
4371
1
نوفمبر 22
4362
0
مايو 23
2238
1
مارس 24
5324