|
| 1 | +.. image:: https://odoo-community.org/readme-banner-image |
| 2 | + :target: https://odoo-community.org/get-involved?utm_source=readme |
| 3 | + :alt: Odoo Community Association |
| 4 | + |
| 5 | +============= |
| 6 | +Filter Button |
| 7 | +============= |
| 8 | + |
| 9 | +.. |
| 10 | + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! |
| 11 | + !! This file is generated by oca-gen-addon-readme !! |
| 12 | + !! changes will be overwritten. !! |
| 13 | + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! |
| 14 | + !! source digest: sha256:329df6eb8c7d4f5db280601a3416d14460c294c342081e38909eabc689074bcf |
| 15 | + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! |
| 16 | +
|
| 17 | +.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png |
| 18 | + :target: https://odoo-community.org/page/development-status |
| 19 | + :alt: Beta |
| 20 | +.. |badge2| image:: https://img.shields.io/badge/license-AGPL--3-blue.png |
| 21 | + :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html |
| 22 | + :alt: License: AGPL-3 |
| 23 | +.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fweb-lightgray.png?logo=github |
| 24 | + :target: https://github.com/OCA/web/tree/16.0/web_filter_header_button |
| 25 | + :alt: OCA/web |
| 26 | +.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png |
| 27 | + :target: https://translation.odoo-community.org/projects/web-16-0/web-16-0-web_filter_header_button |
| 28 | + :alt: Translate me on Weblate |
| 29 | +.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png |
| 30 | + :target: https://runboat.odoo-community.org/builds?repo=OCA/web&target_branch=16.0 |
| 31 | + :alt: Try me on Runboat |
| 32 | + |
| 33 | +|badge1| |badge2| |badge3| |badge4| |badge5| |
| 34 | + |
| 35 | +This module allows to add some selected filters as buttons in the header |
| 36 | +control panel. |
| 37 | + |
| 38 | +**Table of contents** |
| 39 | + |
| 40 | +.. contents:: |
| 41 | + :local: |
| 42 | + |
| 43 | +Use Cases / Context |
| 44 | +=================== |
| 45 | + |
| 46 | +This developement is aimed to ease the filter access for touch screens |
| 47 | +users. |
| 48 | + |
| 49 | +Configuration |
| 50 | +============= |
| 51 | + |
| 52 | +To show a filter in the header of the views, it should have the a |
| 53 | +``context`` attribute with the key ``shown_in_panel``. |
| 54 | + |
| 55 | +.. code:: xml |
| 56 | +
|
| 57 | + <filter |
| 58 | + string="My filter" |
| 59 | + name="my_filter" |
| 60 | + domain="[('active', '!=', False)]" |
| 61 | + context="{'shown_in_panel': True}" |
| 62 | + > |
| 63 | +
|
| 64 | +This will show the filter in the header with its name. You can customize |
| 65 | +the button adding an icon or with a custom name passing an object to |
| 66 | +that key: |
| 67 | + |
| 68 | +.. code:: python |
| 69 | +
|
| 70 | + {'shown_in_panel': {'icon': 'fa-thumbs-up', 'name': 'Ok'}} |
| 71 | +
|
| 72 | +You might be interested in leaving just the icon. In that case, set an |
| 73 | +empty string on the ``name`` property: |
| 74 | + |
| 75 | +.. code:: python |
| 76 | +
|
| 77 | + {'shown_in_panel': {'icon': 'fa-thumbs-up', 'name': ''}} |
| 78 | +
|
| 79 | +You could also want to add a hotkey. In such case add the ``hotkey`` |
| 80 | +property: |
| 81 | + |
| 82 | +.. code:: python |
| 83 | +
|
| 84 | + {'shown_in_panel': {'icon': 'fa-thumbs-up', 'hotkey': 'F'}} |
| 85 | +
|
| 86 | +You can show filter, groups or even favorites. |
| 87 | + |
| 88 | +Usage |
| 89 | +===== |
| 90 | + |
| 91 | +In a search view with header filter buttons, you'll see a filter icon |
| 92 | +(funnel). Use it to unfold the filters. |
| 93 | + |
| 94 | +There's a demo implementation in ``Apps`` and you can play around |
| 95 | +following the *Configure* section. |
| 96 | + |
| 97 | +Known issues / Roadmap |
| 98 | +====================== |
| 99 | + |
| 100 | +- Group filters by kind |
| 101 | +- As we use the ``context`` attribute, the inheritance could be limiting |
| 102 | + in some cases. Keep it in mind or use |
| 103 | + ``base_view_inheritance_extension`` if you want to use proper context |
| 104 | + inheritance. |
| 105 | +- Another nice to have would be to be able to hide the filters in the |
| 106 | + filter list to be able to show them just in the header, although |
| 107 | + there's not a straigh forward way to do it and it could lead to side |
| 108 | + effects. |
| 109 | + |
| 110 | +Bug Tracker |
| 111 | +=========== |
| 112 | + |
| 113 | +Bugs are tracked on `GitHub Issues <https://github.com/OCA/web/issues>`_. |
| 114 | +In case of trouble, please check there if your issue has already been reported. |
| 115 | +If you spotted it first, help us to smash it by providing a detailed and welcomed |
| 116 | +`feedback <https://github.com/OCA/web/issues/new?body=module:%20web_filter_header_button%0Aversion:%2016.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_. |
| 117 | + |
| 118 | +Do not contact contributors directly about support or help with technical issues. |
| 119 | + |
| 120 | +Credits |
| 121 | +======= |
| 122 | + |
| 123 | +Authors |
| 124 | +------- |
| 125 | + |
| 126 | +* Tecnativa |
| 127 | +* Therp Bv |
| 128 | + |
| 129 | +Contributors |
| 130 | +------------ |
| 131 | + |
| 132 | +- `Tecnativa <https://tecnativa.com>`__ |
| 133 | + |
| 134 | + - David Vidal |
| 135 | + |
| 136 | +- `Therp Bv <https://therp.nl>`__ |
| 137 | + |
| 138 | +Maintainers |
| 139 | +----------- |
| 140 | + |
| 141 | +This module is maintained by the OCA. |
| 142 | + |
| 143 | +.. image:: https://odoo-community.org/logo.png |
| 144 | + :alt: Odoo Community Association |
| 145 | + :target: https://odoo-community.org |
| 146 | + |
| 147 | +OCA, or the Odoo Community Association, is a nonprofit organization whose |
| 148 | +mission is to support the collaborative development of Odoo features and |
| 149 | +promote its widespread use. |
| 150 | + |
| 151 | +This module is part of the `OCA/web <https://github.com/OCA/web/tree/16.0/web_filter_header_button>`_ project on GitHub. |
| 152 | + |
| 153 | +You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. |
0 commit comments