Development Book V18: Combining records

In list or kanban views, grouping records helps users quickly analyze and categorize data. The Group By operation in the search view allows users to group records based on specific fields, making it easier to navigate and interpret large datasets.

Instead of manually clicking "Add Custom Group" each time, you can predefine grouping options using the group and filter tags within the search view XML. This makes the grouping options directly available in the UI.

Here’s an example:

<search>
    <group expand="1" string="Group By">
        <filter string="Product Type" name="type" 
            context="{'group_by': 'type'}"/>
    </group>
</search>
  • group defines a group of filters under a common label.
  • expand="1" means the group is expanded by default in the UI.
  • string="Group By" is the label shown in the search panel.
  • The filter tag adds a group-by filter named Product Type.
  • context="{'group_by': 'type'} tells Odoo to group the records by the field type.
odoo-development
whatsapp_icon
location

Calicut

Cybrosys Technologies Pvt. Ltd.
Neospace, Kinfra Techno Park
Kakkancherry, Calicut
Kerala, India - 673635

location

Kochi

Cybrosys Technologies Pvt. Ltd.
1st Floor, Thapasya Building,
Infopark, Kakkanad,
Kochi, India - 682030.

location

Bangalore

Cybrosys Techno Solutions
The Estate, 8th Floor,
Dickenson Road,
Bangalore, India - 560042

Send Us A Message