Filters and Group By:
There are filters and groups by in the search view. Records are filtered based on conditions using the filter command, and groups are grouped based on a field using the group by command. There is a simple way to add these by default, so you don't have to constantly select "Add Custom Filter" or "Add Custom Group."The search tag's filter tag is used to add a filter.
For eg:
<filter string="Gender" name="gender"
context="{'group_by': 'gender'}"/>
You will see all the archived records when you select the archived filter. Different filtering conditions can be specified in the domain attribute. If you choose to group by, you can include filters both inside the group tag and the search tag.
i.e.,
<group expand="0" string="Group By">
<filter string="Gender" name="gender" context="{'group_by': 'gender'}"/>
</group>
Applying a gender grouping here.The data will be sorted according to the gender field. Context is used to pass data for grouping.
While other fields can also be used for the group by filters, the attribute name is necessary.