Skip to Content
Menu
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
To pytanie dostało ostrzeżenie
2 Odpowiedzi
2979 Widoki

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.

Awatar
Odrzuć
Najlepsza odpowiedź

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.

Awatar
Odrzuć
Autor Najlepsza odpowiedź

Thank you a lot, it worked fine!

Awatar
Odrzuć

Happy to help. Thanks

Powiązane posty Odpowiedzi Widoki Czynność
0
lut 24
1691
1
lis 22
14142
2
lip 22
5403
1
lis 20
2649
1
lis 17
4306