Overslaan naar inhoud
Menu
Je moet geregistreerd zijn om te kunnen communiceren met de community.
Deze vraag is gerapporteerd
2 Antwoorden
3047 Weergaven

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.

Avatar
Annuleer
Beste antwoord

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.

Avatar
Annuleer
Auteur Beste antwoord

Thank you a lot, it worked fine!

Avatar
Annuleer

Happy to help. Thanks

Gerelateerde posts Antwoorden Weergaven Activiteit
0
feb. 24
1781
1
nov. 22
14193
2
jul. 22
5509
1
nov. 20
2733
1
nov. 17
4338