Zum Inhalt springen
Menü
Sie müssen registriert sein, um mit der Community zu interagieren.
Diese Frage wurde gekennzeichnet
2 Antworten
2983 Ansichten

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
Verwerfen
Beste Antwort

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
Verwerfen
Autor Beste Antwort

Thank you a lot, it worked fine!

Avatar
Verwerfen

Happy to help. Thanks

Verknüpfte Beiträge Antworten Ansichten Aktivität
0
Feb. 24
1694
1
Nov. 22
14144
2
Juli 22
5405
1
Nov. 20
2654
1
Nov. 17
4309