How to do it...

  1. Define your search view:
<record id="search_all_customers" model="ir.ui.view"> 
    <field name="model">res.partner</field> 
    <field name="arch" type="xml"> 
        <search> 
          <field name="name" /> 
          <field name="category_id" 
filter_domain="[('category_id', 'child_of', self)]" /> <field name="bank_ids" widget="many2one" /> <filter name="suppliers" string="Suppliers"
domain="[('supplier', '=', True)]" />
<group expand="0" string="Group By">
<filter string="Country" name="country"
context="{'group_by':'country_id'}"/>
</group> </search> </field> </record>
  1. Tell your action to use it:
<record id="action_all_customers" model="ir.actions.act_window"> 
    <field name="name">All customers</field> 
    <field name="res_model">res.partner</field> 
    <field name="domain">[('customer', '=', True)]</field> 
    <field name="search_view_id" ref="search_all_customers" /> 
</record> 

When you type something in to the search bar now, you'll be offered the ability to search for this term in the name, categories, and bank account fields. If your term happens to be a substring of a bank account number in your system, you'll even be offered to search exactly for this bank account.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset