Advanced Use Cases: Filters and Status Bar¶
Case scenario 1: on Sales, set a filter on Belgian customers and define it as the default one (the user should still be able to unset the filter).
On your customer’s page, use Filters > Add Custom Filter to group customers by country. Now, under Favorites, Save Current Search enabling Use by default and Save.
![View of a custom filter being set to be used by default in Odoo](../../../../_images/customer_filter.png)
On Filter Rules in Studio mode, select the respective filter and enable Default Filter.
![View of a filter’s rule form emphasizing the field default filter in Odoo Studio](../../../../_images/sales_default_filter.png)
Case scenario 2: add a status bar on the product form to manage its life cycle. Set the values: ‘Prototype’, ‘In use’ and ‘Deprecated’. By default, the Kanban view must be grouped by status.
![Form view emphasizing the button add a pipeline bar in Odoo Studio](../../../../_images/add_pipeline.png)
Now, open your product form and set the right status for that product. As you move products throughout stages (also through the product’s form), stages are shown in the Kanban view.
Tip
To make modifications in the pipeline status bar, for example, remember to go back to Form View.
![View of Studio emphasizing the form view button in Odoo Studio](../../../../_images/form_view.png)
Case scenario 2.a: when a product goes from ‘In use’ to ‘Deprecate’, set its cost to 0€.
Create an automated action with the selected values:
Model: Product Template
Trigger: On Update
First Domain: Pipeline status bar = In use
Second Domain: Pipeline status bar = Deprecated
Action To Do: Update the Record
Data to Write: Cost (Product Template) > Value > 0
![View of the automated action created to set the price of a product to zero in Odoo Studio](../../../../_images/automations_zero_price.png)
See also