跳至内容
菜单
此问题已终结
2 回复
3039 查看

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
2月 24
1759
1
11月 22
14184
2
7月 22
5476
1
11月 20
2717
1
11月 17
4330