This question has been flagged
1 Reply
11218 Views

Hi

how to add search multiple of three field

this  code is working

<field name="street"    filter_domain="['|',('street','ilike',self),('city','ilike',self) string="Rue" />

but when i add field street2 to this code is not working

<field name="street"    filter_domain="['|',('street','ilike',self),('city','ilike',self),('street2','ilike',self)]" string="Rue" />

 

Thanks

Avatar
Discard
Best Answer

For setting a domain in Odoo, It is a common terminology to use

AND CONDITION: domain = [('street','ilike',self),('city','ilike',self)]

OR CONDITION: domain = ['|',('street','ilike',self),('city','ilike',self)]

So, use this condition for your case:

<field name="street"    filter_domain="['|',  '|', ('street','ilike',self),('city','ilike',self),('street2','ilike',self)]" string="Rue" />

I have a added an "OR condition" in the filter_domain, so that you can search in either street, city or street2.

 

Avatar
Discard
Author

Thank you it works