Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
2 ตอบกลับ
2923 มุมมอง

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

Related Posts ตอบกลับ มุมมอง กิจกรรม
0
ก.พ. 24
1608
1
พ.ย. 22
14059
2
ก.ค. 22
5317
1
พ.ย. 20
2597
1
พ.ย. 17
4263