Skip to main content

Show selected filters as buttons in the control panel

Project description

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': 'fa-thumbs-up', 'name': 'Ok'}}

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

{'shown_in_panel': {'icon': 'fa-thumbs-up', 'name': ''}}

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

{'shown_in_panel': {'icon': 'fa-thumbs-up', 'hotkey': 'F'}}

You can show filter, groups or even favorites.

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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

File details

Details for the file odoo_addon_web_filter_header_button-18.0.1.0.0.4-py3-none-any.whl.

File metadata

File hashes

Hashes for odoo_addon_web_filter_header_button-18.0.1.0.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 3b7c43c4c860df4c2105fe96dc899298322b23b973128c431444a0c4bf7832d0
MD5 cebd82880e07237f8aa98534358bbf69
BLAKE2b-256 f39ddcdf4cedd288e6101c4d2c8f8357c84dcb96ae21dca727cea7e37f35beeb

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page