Search views

The search options available are defined through the <search> view type. We can choose the fields that can be automatically searched when typing in the search box. We can also provide predefined filters, activated with a click, and predefined grouping options to be used in list views.

Here is a possible search view for the To-Do Tasks:

<record id="view_filter_todo_task" 
  model="ir.ui.view"> 
  <field name="model">todo.task</field> 
  <field name="priority">15</field>   <field name="arch" type="xml"> 
    <search>      <field name="name"/> 
      <field name="user_id"/>       <filter name="filter_not_done" string="Not Done"  
        domain="[('is_done','=',False)]"/> 
      <filter name="filter_done" string="Done"  
        domain="[('is_done','!=',False)]"/> <separator/> <filter name="group_user" ...

Get Odoo 11 Development Essentials - Third Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.