O'Reilly logo

Odoo Development Essentials by Daniel Reis

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Search views

The search options available on views are defined with a search view. It defines the fields to be searched when typing in the search box It also provides predefined filters that can be activated with a click, and data grouping options for the records on list and kanban views.

Here is a search view for the to-do tasks:

<record id="todo_app.view_filter_todo_task" model="ir.ui.view"> <field name="name">To-do Task Filter</field> <field name="model">todo.task</field> <field name="arch" type="xml"> <search> <field name="name" domain_filter="['|', ('name','ilike',self),('user_id','ilike',self)]"/> <field name="user_id"/> <filter name="filter_not_done" string="Not Done" domain="[('is_done','=',False)]"/> <filter name="filter_done" string="Done" ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required