Skip to main content
Odoo Community Association

Filter Button

Beta License: AGPL-3 OCA/web Translate me on Weblate Try me on Runboat

This module allows to add some selected filters as buttons in the header control panel.

Table of contents

Use Cases / Context

This developement is aimed to ease the filter access for touch screens users.

Configuration

To show a filter in the header of the views, it should have the a context attribute with the key shown_in_panel.

<filter
    string="My filter"
    name="my_filter"
    domain="[('active', '!=', False)]"
    context="{'shown_in_panel': True}"
>

This will show the filter in the header with its name. You can customize the button adding an icon or with a custom name passing an object to that key:

{'shown_in_panel': {'icon': 'thumb_up', 'name': 'Ok'}}

The icon is the name of an icon of the Odoo icon font (Material Symbols), the same value used in the data-icon attribute of the oi icons (e.g.: thumb_up, toggle_on, business…).

Extra classes for the icon can be set with the iconClass property. For example, to show the filled variant of the icon:

{'shown_in_panel': {'icon': 'star', 'iconClass': 'oi-filled'}}

You might be interested in leaving just the icon. In that case, set an empty string on the name property:

{'shown_in_panel': {'icon': 'thumb_up', 'name': ''}}

You could also want to add a hotkey. In such case add the hotkey property:

{'shown_in_panel': {'icon': 'thumb_up', 'hotkey': 'F'}}

You can show filters (date filters included), groups (by date as well) or even favorites. Date filters and date groups are applied with their default period or interval.

Usage

In a search view with header filter buttons, you’ll see a filter icon (funnel). Use it to unfold the filters.

There’s a demo implementation in Apps and you can play around following the Configure section.

Known issues / Roadmap

  • Group filters by kind

  • As we use the context attribute, the inheritance could be limiting in some cases. Keep it in mind or use base_view_inheritance_extension if you want to use proper context inheritance.

  • Another nice to have would be to be able to hide the filters in the filter list to be able to show them just in the header, although there’s not a straigh forward way to do it and it could lead to side effects.

Bug Tracker

Bugs are tracked on GitHub Issues. In case of trouble, please check there if your issue has already been reported. If you spotted it first, help us to smash it by providing a detailed and welcomed feedback.

Do not contact contributors directly about support or help with technical issues.

Credits

Authors

  • Tecnativa

Contributors

Maintainers

This module is maintained by the OCA.

Odoo Community Association

OCA, or the Odoo Community Association, is a nonprofit organization whose mission is to support the collaborative development of Odoo features and promote its widespread use.

This module is part of the OCA/web project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

Metadata

Release files for odoo-addon-web-filter-header-button 20.0.1.0.0.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distribution (wheel)

Table of built distributions (wheels) for odoo-addon-web-filter-header-button 20.0.1.0.0.3
File Interpreter ABI Platform Actions
odoo_addon_web_filter_header_button-20.0.1.0.0.3-py3-none-any.whl Python 3 none any Details for odoo_addon_web_filter_header_button-20.0.1.0.0.3-py3-none-any.whl

Release files / odoo_addon_web_filter_header_button-20.0.1.0.0.3-py3-none-any.whl

Download URL odoo_addon_web_filter_header_button-20.0.1.0.0.3-py3-none-any.whl
Size 38.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
88bdece6a576a8d2d422369e42e1f9b4b6f3a6d10d52f90f815ca9ae96c19069
BLAKE2b-256 checksum
How to use checksums
28ab7f21c6b08369701ed329e0e7889599842912b88fa6f0b3b495d000e9e989
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.4

Security for odoo-addon-web-filter-header-button 20.0.1.0.0.3

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page