Siirry sisältöön
Menu
Sinun on rekisteröidyttävä, jotta voit olla vuorovaikutuksessa yhteisön kanssa.
Tämä kysymys on merkitty
2 Vastaukset
2971 Näkymät

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
Hylkää
Paras vastaus

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
Hylkää
Tekijä Paras vastaus

Thank you a lot, it worked fine!

Avatar
Hylkää

Happy to help. Thanks

Aiheeseen liittyviä artikkeleita Vastaukset Näkymät Toimenpide
0
helmik. 24
1690
1
marrask. 22
14135
2
heinäk. 22
5392
1
marrask. 20
2645
1
marrask. 17
4305