Global filters¶
Global filters, represented by the Filters icon at the top right of an Odoo spreadsheet, allow you to apply one or more filters to all the Odoo data that has been inserted in that spreadsheet.
These filters are particularly useful for reports and dashboards as users can easily and dynamically customize the view to answer complex business questions spanning multiple data sources.
ちなみに
When a spreadsheet with global filters is added to a dashboard, the filters appear as dropdown menus at the top of the dashboard. In a spreadsheet, they appear in a pane to the right of the spreadsheet.

Three types of global filters are available:
Date: filters data based on a specific time range, with the options Month / Quarter, Relative Period, or From / To.
Relation: filters data based on a relational field in a related model, e.g., by Salesperson with the User model set as the related model.
Text: filters data based on a string of text or a range of predefined values, e.g., a product reference or barcode.
Unlike the standard (Add filters) spreadsheet function, which lets you sort and temporarily hide data, global filters act on the underlying data sources, filtering data before it is loaded into the spreadsheet.
When a global filter is created, field matching for each data source ensures the filter acts on the correct database fields.
ちなみに
Global filters work by adding extra conditions to the domains of all the data sources in the spreadsheet. Therefore, if you intend to use global filters, do not use the same conditions when configuring the initial list, pivot table, or chart in your database.
Setting default values, where relevant, ensures that the spreadsheet or dashboard loads quickly and provides a useful initial view that can be further customized if needed. For example, a Date filter could be set to show data from the last 30 days by default.
フィールドマッチング¶
重要
This process is crucial, as matching the wrong fields, or not setting matching fields at all, results in global filters that do not show the desired results.
To function as intended, a global filter needs to act on the correct database fields. Consider a Date filter applied to sales data. As the Sales Order model contains several date fields, it is crucial to determine which field is relevant for the filter, e.g., the order date, the delivery date, the expected date, or the expiration date.
When creating a global filter, the Field matching section of the Filter properties allows you to determine, for each data source in the spreadsheet, which database field the filter should act on, or match with.
Field matching is further explained in the relevant sections on creating Date, Relation, and Text global filters.
Create global filters¶
Open the desired spreadsheet from the Odoo Documents app or via the Odoo Dashboards app if you are adding filters to a dashboard.
ちなみに
To access the underlying spreadsheet of a dashboard, with the Dashboards app open, activate developer mode, then click the (Edit) icon that appears when hovering over the dashboard name.
To add a new filter, click Filters, then, under Add a new filter... click Date, Relation, or Text as appropriate. The Filter properties pane opens.
When saving a global filter, if any required information is missing or if any information provided in the Field matching section is not appropriate, an error is shown stating Some required fields are not valid.
日付¶
注釈
A Date filter can only match with a Date or Date & Time field.
With the Filter properties pane open:
Enter a name for the new date filter in the Label field.
From the Time range dropdown menu, select one of the following:
Month / Quarter: enables a dropdown menu of specific months and/or quarters and a year selector for the year. The values Months and Quarters are enabled by default. Disabling both of these values allows filtering by year only.
To set a Default value, enable Automatically filter on the current period and choose whether to filter on the current Month, Quarter or Year.
Relative Period: enables a dropdown menu of specific time ranges relative to the current date (e.g., Year to Date, Last 7 Days, Last 30 Days, etc.).
To set a Default value, select one of the available values.
From / To: enables Date from... and Date to... date selection fields to define a specific time range (e.g.,
06/05/2024
to06/27/2024
).
In the Field matching section, for each data source, click below Date field and select the field the filter should match with.
The Period offset feature enables comparisons to be made by shifting the time range by one or two periods in the past or future. By default, no period offset is set. The offsets available are: Previous, Before previous, Next, and After next.
ちなみに
To compare data effectively using the Period offset feature, duplicate the relevant inserted list or pivot table, then, when setting up field matching, set a period offset for the second data source but not the first.
When applying the filter, the original list or pivot table shows data for the time range selected, while the second shows data for a period before or after that time range, as defined.
保存 をクリックします。
Example
In the example below, a Date global filter has been created to allow the pivot table and chart to show sales data per quarter. If only a year is selected, data is shown for the entire year.

In the Field matching section of the Filter properties, the field Order Date has been selected as the matching date field. A matching date field is not needed for List #1 as we will not use this filter on the data source in question.

関係¶
With the Filter properties pane open:
Enter a name for the new relation filter in the Label field.
In the Related model field, start typing the model name to reveal a list of all models, then select the appropriate one. Once a model is selected, the Default value and Possible values fields appear, as well as the Field matching section.
To set a Default value, select one of the available values; these are records from the model. If the related model is the User model, the option Automatically filter on the current user can be enabled.
To limit the values that can be shown, enable Restrict values with a domain, then click Edit domain to add or edit rules.
In the Field matching section, check if the correct matching field has been assigned for each data source. If this is not the case, click below the data source name to select the correct field.
保存 をクリックします。
Example
In the example below, a Relation filter has been created to allow the pivot table and chart to show sales data related to selected salespeople only. The User model was set as the Related model.

In the Field matching section of the Filter properties, the field Salesperson was automatically assigned as the matching field for both the pivot table and the chart. A matching field is not needed for List #1 as we will not use this filter on the data source in question.

テキスト¶
注釈
A Text filter can only match with a Text (char), Integer or Decimal (float) field.
With the Filter properties pane open:
Enter a name for the new text filter in the Label field.
Optionally, enable Restrict values to a range. Doing so allows you to input a spreadsheet range either by typing the range or selecting it from within the spreadsheet.
Optionally, enter a Default value.
In the Field matching section, for each data source click below the data source name and select the field the Text filter should match with.
保存 をクリックします。
Example
In the example below, a Text global filter was created to allow the user to select a product from the Product filter and have both the pivot table and chart only show sales data related to that specific product.

In the Filter properties, the Possible values of the filter were restricted to the range 'Products (List #1)'!A2:A34. This corresponds to the range containing the Display name of the product on a list inserted in the spreadsheet.

With this configuration, the pivot table and chart can be filtered by product name by selecting one of the predefined values available in the text filter. In this case, Furniture has already been selected as the Product category, meaning that only products of this category can be selected as possible values.
Furthermore, if the values in the range have been retrieved dynamically from the database, as in this case, the text filter is also dynamic, i.e., will reflect changes made to those values.
Manage and use global filters¶
Click the Filters icon at the top right of an Odoo spreadsheet to access the global filters that have been created for that spreadsheet.
It is possible to:
Apply one or more global filters by selecting appropriate values per filter, as relevant.
ちなみに
Reloading the browser will cause any global filters to reset to their initial state or default value, as relevant. To refresh data in an inserted list, pivot table, or chart without losing global filters that have been applied, click
from the menu bar.Change the order of existing filters by hovering over a filter and using the (drag handle) icon to change the position.
Clear filter values (whether default or selected values) by clicking the (Clear) icon next to the value in the filter.
Edit an existing filter by selecting the (Edit) icon to open the filter's Filter properties then editing as needed.
Delete an existing filter by selecting the (Edit) icon to open the filter's Filter properties then clicking Remove.