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?
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
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?
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
Hi
my be you need some update like this
result = self.env['hr.employee'].search(['&',('marital', '=', 'single'),('gender', '=', 'male')])
Maak vandaag nog een account aan om te profiteren van exclusieve functies en deel uit te maken van onze geweldige community!
AanmeldenGerelateerde posts | Antwoorden | Weergaven | Activiteit | |
---|---|---|---|---|
|
1
apr. 20
|
142 | ||
|
1
jun. 19
|
4119 | ||
|
2
jun. 18
|
89 | ||
|
0
mrt. 18
|
5732 | ||
|
3
mei 24
|
3564 |