Odoo Help


Filter begins with and greater or less than

on 1/27/14, 3:53 AM 2,473 views

Good day

Please advise how one might filter partners with additional conditions that are not available in the current filter options. I have a database with a field for number of employees.

I would like to filter for greater or less than a certain number of employees.

I also have other fields that I want to use other conditions for such as: Begins with - i.e. we have segmented using codes such as AYR which equals (A) Highest class client, (Y) Product they buy from us, (R) Cycle they are on. So I want a filter that says Field begins with A

etc etc.


shashank verma
On 1/27/14, 4:14 AM

Hello Dale

Use domain field in xml file to set your own conditions for filtering

syntax domain="[('field_name,'operator',value]

assume for product module go to product module-> open product_view.xml

<record id="product_search_form_view" model="ir.ui.view">

        <field name="name">product.search.form</field>
        <field name="model">product.product</field>

        <field name="arch" type="xml">

            <search string="Product">
               <field name="name" string="Product" filter_domain="['|',('name','ilike',self),('default_code','ilike',self)]"/>
               <filter string="Services" icon="terp-accessories-archiver" domain="[('type','=','service')]"/>
               <filter string="Consumable" name="consumable" icon="terp-accessories-archiver" domain="[('type','=','consu')]" help="Consumable products"/>
               <filter string="Can be Sold" name="filter_to_sell" icon="terp-accessories-archiver-minus" domain="[('sale_ok','=',1)]"/>
               <field name="categ_id"/>
               <group expand="0" string="Context...">
                   <field name="pricelist_id" context="{'pricelist': self}" groups="product.group_sale_pricelist"/>
                   <field name="company_id" groups="base.group_multi_company"/>
               <group  expand='0' string='Group by...'>
                   <filter string='Category' icon="terp-stock_symbol-selection" domain="[]" context="{'group_by' : 'categ_id'}"/>
                   <filter string='Default Unit of Measure' icon="terp-mrp" domain="[]" context="{'group_by' : 'uom_id'}"/>
                   <filter string='Type' icon="terp-stock_symbol-selection" domain="[]" context="{'group_by' : 'type'}"/>
                   <filter string='Company' icon="terp-go-home" domain="[]" context="{'group_by' : 'company_id'}" groups="base.group_multi_company"/>

here u can add or modify domain .

Thanks Shashank. I am new to this. Could you possibly give me the steps as to where I do this?

on 1/27/14, 4:29 AM

i have updated my post above, Hope this will help u

shashank verma
on 1/27/14, 9:18 AM

Great that's exactly what we needed. Thanx!!!

on 1/27/14, 9:24 AM

About This Community

This platform 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.


Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

0 follower(s)


Asked: 1/27/14, 3:53 AM
Seen: 2473 times
Last updated: 3/16/15, 8:10 AM