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

I'm trying to retrieve from script all the product published except for one category, this method is invoked by an automadet action. The code is:




The issue is that the search is returning all the product template, not only the website_published = true, can anyone help to understand the issue in the code?


Thank you.

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

Hi,

    Try giving the reverse way, ('website_published', '!=', False)

    The domain inside the search normally uses the AND operation , you need not mention and in between your conditions. You can simply give a "comma", [('website_published', '!=', False), ('public_categ_ids', 'not in', (7)]. This is just for your information. 
I guess the domain fails due to your second condition, i guess public_categ_ids is a many2many field so try giving as above

Hope it helps.

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

Thank you a lot, it worked fine!

الصورة الرمزية
إهمال

Happy to help. Thanks

المنشورات ذات الصلة الردود أدوات العرض النشاط
0
فبراير 24
1691
1
نوفمبر 22
14140
2
يوليو 22
5400
1
نوفمبر 20
2648
1
نوفمبر 17
4306