Odoo, the powerful open-source ERP system, offers robust customization through XML views. One of the most practical and user-friendly ways to enhance the usability of list views in Odoo is to use filters and group-by options. These tools allow users to quickly find and analyze data without writing a single line of code on the front end.
In this blog post, we’ll explore two powerful features in Odoo 18 that help users manage and analyze data effectively: Filters and Group By functionality. These tools are essential for any Odoo user who wants to work efficiently with large datasets.
What are Filters in Odoo?
Filters in Odoo allow you to display only the records that match specific criteria. They help you focus on relevant data by hiding records that don’t meet your conditions.
Filters are defined using domains and can be added via XML or the Odoo interface. They make it easier to manage and analyze large amounts of data precisely.
Types of Filters:
- Default Filters: Predefined filters that come with standard Odoo modules (e.g., “My Pipeline”, “Open Tasks”).
- Custom Filters: User-defined filters created on the fly or through XML for specific business needs.
- Global Filters: Filters applicable across multiple views or models, often used in dashboards.
- Contextual Filters: Dynamic filters that use context variables like uid, today(), or user input.
The right filters can reduce searching time and help users make quicker, data-driven decisions.
Group By :
Group By in Odoo allows users to organize records into meaningful groups based on the values of a specific field. This functionality is especially useful for analyzing data patterns, comparing performance, and summarizing key metrics.
Creating Custom Filters in Odoo 18
Let’s say you want to improve how your team works with the Sales Orders list view in Odoo 18. To do that, you can customize the search options to make important data easier to access.
First, you want to add a filter that shows only the Sales Orders that have been invoiced. This helps users quickly find completed orders without scrolling through drafts or quotations.
Next, you want to add a Group By option so that Sales Orders can be categorized by Salesperson. This is useful for tracking individual performance or organizing orders by responsible users.
Finally, you want to make sure both of these options are visible in the search bar, so users can apply them instantly—no need to recreate filters manually or dig through menus.
This kind of customization makes the list view cleaner, faster to use, and tailored to your team’s daily workflow.
Step 1: Inherit the search View
Let’s start by inheriting the default search view for sale.order.
sale.order.
views/sale_order_views.xml:
sale.order.filter.inherit
sale.order
Now your Sales Order search bar has:
- A new filter: “Fully Invoiced”
- A new group option: “Salesperson”
Step 2: Set Default Filter and Group By
Let’s take it a step further — not only do we want to add the filter and group by options, but we also want Odoo to apply them automatically when the user opens the Sales Orders list view. In other words, the system should load the view with the “Invoiced Orders” filter and grouped by Salesperson right from the start.
There are two ways to achieve this:
Option A – Override the Existing Action
If you’re okay changing the default behavior:
{
'search_default_invoiced_orders': 1,
'group_by': 'user_id'
}
Option B – Create a New Menu + Action
If you want a dedicated menu with the filter/grouping applied:
Invoiced Sales Orders
sale.order
list,form
{
'search_default_invoiced_orders': 1,
'group_by': 'user_id'
}
Result :
When the user clicks Invoiced Orders:
- The list opens grouped by Salesperson
- Only fully invoiced orders are shown
- Users can still remove the filter or group by something else
Final Thoughts on Customizing Filters and Groupings in Odoo
Customizing filters and groupings in Odoo using XML is simple, user-friendly, and safe when done within your own module. It’s a powerful technique that works across all models—whether you’re working in CRM, Accounting, Inventory, Projects, or even custom-built apps.



