İçereği Atla
Menü
Bu soru işaretlendi
2 Cevaplar
16258 Görünümler

I'm trying to use search with 2 values like example:

result = self.env['hr.employee'].search([('marital', '=', 'single'), '&', ('gender', '=', 'male')])

But I only get error "ValueError: Invalid leaf &". How can I search with and?

Avatar
Vazgeç
En İyi Yanıt

In you case, no need to put "&".

Odoo uses Polish Notation for Domain filters.

See this one for more details : https://stackoverflow.com/questions/45506255/odoo-multiple-condition-in-domain-error

Avatar
Vazgeç
En İyi Yanıt
Hi 
my be you need some update like this

result = self.env['hr.employee'].search(['&',('marital', '=', 'single'),('gender', '=', 'male')])
Avatar
Vazgeç
İlgili Gönderiler Cevaplar Görünümler Aktivite
1
Nis 20
142
1
Haz 19
4217
2
Haz 18
89
0
Mar 18
5832
3
May 24
3695