Odoo Help

Welcome!

This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

0

how to add search multiple

By
oussama
on 10/23/14, 1:17 PM 1,294 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

0

Atchuthan - Technical Consultant, Sodexis Inc

--Atchuthan - Technical Consultant, Sodexis Inc--
3883
| 5 3 8
Puducherry, India
--Atchuthan - Technical Consultant, Sodexis Inc--
Passionate coder in Python/Odoo(formerly known as OpenERP).

Contact me via GMail: atchuthantu@gmail.com via Skype: atchuthan_skype
via Linkedin: http://in.linkedin.com/in/atchuthantu
Atchuthan - Technical Consultant, Sodexis Inc
On 10/24/14, 1:39 AM

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.

 

Thank you it works

oussama
on 10/24/14, 3:41 AM

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)

Stats

Asked: 10/23/14, 1:17 PM
Seen: 1294 times
Last updated: 3/16/15, 8:10 AM