コンテンツへスキップ
メニュー
この質問にフラグが付けられました
1 返信
12037 ビュー

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

アバター
破棄
最善の回答

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