search view odoo code example

Example: define search view odoo

<record id="student_search_view" model="ir.ui.view">   <field name="name">Students Search View</field>   <field name="model">student.student</field>   <field name="arch" type="xml">       <search string="Search Student">           <field name="name"/>           <field name="age"/>           <field name="nationality"/>           <filter string="Male" name="male" domain="[('gender','=','male')]"                   help="Students with gender as Male"/>           <filter string="Female" name="female" domain="[('gender','=','female')]"                   help="Students with gender as Female"/>           <filter string="Others" name="others" domain="[('gender','=','others')]"                   help="Students with gender as Others"/>           <group expand="1" string="Group By">               <filter string="Nationality" name="nationality" context="{'group_by':'nationality'}"/>               <filter string="Blood Group" name="blood_group" context="{'group_by':'student_blood_group'}"/>           </group>       </search>   </field></record>

Tags:

Misc Example