Skip to content

Commit

Permalink
[MIG] web_edit_user_filter: Migration to 15.0
Browse files Browse the repository at this point in the history
  • Loading branch information
amh-mw committed Jul 22, 2024
1 parent 1af34bc commit 112f751
Show file tree
Hide file tree
Showing 9 changed files with 44 additions and 81 deletions.
6 changes: 6 additions & 0 deletions setup/web_edit_user_filter/setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import setuptools

setuptools.setup(
setup_requires=['setuptools-odoo'],
odoo_addon=True,
)
16 changes: 8 additions & 8 deletions web_edit_user_filter/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Edit User Filters
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:42a237e72292f5c09e0b1846ccc3d939ee6f7e1c2749fd3c05e4b12efeea336a
!! source digest: sha256:4cc9e36f8b83405fb9429e15bbbfbb762910146226d25a928e6a6ec05b91566c
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
.. |badge1| image:: https://img.shields.io/badge/maturity-Production%2FStable-green.png
Expand All @@ -17,13 +17,13 @@ Edit User Filters
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fweb-lightgray.png?logo=github
:target: https://github.com/OCA/web/tree/14.0/web_edit_user_filter
:target: https://github.com/OCA/web/tree/15.0/web_edit_user_filter
:alt: OCA/web
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/web-14-0/web-14-0-web_edit_user_filter
:target: https://translation.odoo-community.org/projects/web-15-0/web-15-0-web_edit_user_filter
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
:target: https://runboat.odoo-community.org/builds?repo=OCA/web&target_branch=14.0
:target: https://runboat.odoo-community.org/builds?repo=OCA/web&target_branch=15.0
:alt: Try me on Runboat

|badge1| |badge2| |badge3| |badge4| |badge5|
Expand All @@ -49,7 +49,7 @@ Edit a favourite filter:
#. Select a filter and click on the star icon of the filter name
#. click on the pencil icon to start editing the filter.

.. image:: https://raw.githubusercontent.com/web_edit_user_filter/static/description/select_facet.png
.. image:: https://raw.githubusercontent.com/OCA/web/15.0/web_edit_user_filter/static/description/select_facet.png
:alt: Select Facet

Edit a facet:
Expand All @@ -58,7 +58,7 @@ Edit a facet:
#. a menu is now shown which allows you to remove values from the facet;
#. to cancel removal you can click outside the popover.

.. image:: https://raw.githubusercontent.com/web_edit_user_filter/static/description/edit_facet.png
.. image:: https://raw.githubusercontent.com/OCA/web/15.0/web_edit_user_filter/static/description/edit_facet.png
:alt: Edit Facet

Known issues / Roadmap
Expand All @@ -73,7 +73,7 @@ Bug Tracker
Bugs are tracked on `GitHub Issues <https://github.com/OCA/web/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 <https://github.com/OCA/web/issues/new?body=module:%20web_edit_user_filter%0Aversion:%2014.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
`feedback <https://github.com/OCA/web/issues/new?body=module:%20web_edit_user_filter%0Aversion:%2015.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.

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

Expand Down Expand Up @@ -105,6 +105,6 @@ 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 <https://github.com/OCA/web/tree/14.0/web_edit_user_filter>`_ project on GitHub.
This module is part of the `OCA/web <https://github.com/OCA/web/tree/15.0/web_edit_user_filter>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
13 changes: 10 additions & 3 deletions web_edit_user_filter/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,20 @@
{
"name": "Edit User Filters",
"category": "Extra Tools",
"version": "14.0.1.0.1",
"version": "15.0.1.0.0",
"author": "Onestein,Level Prime Srl,Odoo Community Association (OCA)",
"website": "https://github.com/OCA/web",
"development_status": "Production/Stable",
"license": "AGPL-3",
"depends": ["web"],
"data": ["templates/assets.xml"],
"qweb": ["static/src/xml/backend.xml", "static/src/xml/search_extended.xml"],
"installable": True,
"assets": {
"web.assets_backend": [
"web_edit_user_filter/static/src/js/*.js",
"web_edit_user_filter/static/src/scss/*.scss",
],
"web.assets_qweb": [
"web_edit_user_filter/static/src/xml/*.xml",
],
},
}
4 changes: 2 additions & 2 deletions web_edit_user_filter/readme/USAGE.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Edit a favourite filter:
#. Select a filter and click on the star icon of the filter name
#. click on the pencil icon to start editing the filter.

.. image:: /web_edit_user_filter/static/description/select_facet.png
.. image:: ../static/description/select_facet.png
:alt: Select Facet

Edit a facet:
Expand All @@ -15,5 +15,5 @@ Edit a facet:
#. a menu is now shown which allows you to remove values from the facet;
#. to cancel removal you can click outside the popover.

.. image:: /web_edit_user_filter/static/description/edit_facet.png
.. image:: ../static/description/edit_facet.png
:alt: Edit Facet
12 changes: 6 additions & 6 deletions web_edit_user_filter/static/description/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -367,9 +367,9 @@ <h1 class="title">Edit User Filters</h1>
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:42a237e72292f5c09e0b1846ccc3d939ee6f7e1c2749fd3c05e4b12efeea336a
!! source digest: sha256:4cc9e36f8b83405fb9429e15bbbfbb762910146226d25a928e6a6ec05b91566c
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<p><a class="reference external image-reference" href="https://odoo-community.org/page/development-status"><img alt="Production/Stable" src="https://img.shields.io/badge/maturity-Production%2FStable-green.png" /></a> <a class="reference external image-reference" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/OCA/web/tree/14.0/web_edit_user_filter"><img alt="OCA/web" src="https://img.shields.io/badge/github-OCA%2Fweb-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/web-14-0/web-14-0-web_edit_user_filter"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external image-reference" href="https://runboat.odoo-community.org/builds?repo=OCA/web&amp;target_branch=14.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
<p><a class="reference external image-reference" href="https://odoo-community.org/page/development-status"><img alt="Production/Stable" src="https://img.shields.io/badge/maturity-Production%2FStable-green.png" /></a> <a class="reference external image-reference" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/OCA/web/tree/15.0/web_edit_user_filter"><img alt="OCA/web" src="https://img.shields.io/badge/github-OCA%2Fweb-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/web-15-0/web-15-0-web_edit_user_filter"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external image-reference" href="https://runboat.odoo-community.org/builds?repo=OCA/web&amp;target_branch=15.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
<p>In standard Odoo you can edit user filters via the debug module.
The problem is that normal users often don’t have access to this menu therefore can’t adjust filters once they’re saved.
This module makes this feature available for normal users with a user friendly interface.
Expand Down Expand Up @@ -398,14 +398,14 @@ <h1><a class="toc-backref" href="#toc-entry-1">Usage</a></h1>
<li>Select a filter and click on the star icon of the filter name</li>
<li>click on the pencil icon to start editing the filter.</li>
</ol>
<img alt="Select Facet" src="https://raw.githubusercontent.com/web_edit_user_filter/static/description/select_facet.png" />
<img alt="Select Facet" src="https://raw.githubusercontent.com/OCA/web/15.0/web_edit_user_filter/static/description/select_facet.png" />
<p>Edit a facet:</p>
<ol class="arabic simple">
<li>Click on the facet;</li>
<li>a menu is now shown which allows you to remove values from the facet;</li>
<li>to cancel removal you can click outside the popover.</li>
</ol>
<img alt="Edit Facet" src="https://raw.githubusercontent.com/web_edit_user_filter/static/description/edit_facet.png" />
<img alt="Edit Facet" src="https://raw.githubusercontent.com/OCA/web/15.0/web_edit_user_filter/static/description/edit_facet.png" />
</div>
<div class="section" id="known-issues-roadmap">
<h1><a class="toc-backref" href="#toc-entry-2">Known issues / Roadmap</a></h1>
Expand All @@ -419,7 +419,7 @@ <h1><a class="toc-backref" href="#toc-entry-3">Bug Tracker</a></h1>
<p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/web/issues">GitHub Issues</a>.
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
<a class="reference external" href="https://github.com/OCA/web/issues/new?body=module:%20web_edit_user_filter%0Aversion:%2014.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
<a class="reference external" href="https://github.com/OCA/web/issues/new?body=module:%20web_edit_user_filter%0Aversion:%2015.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
<p>Do not contact contributors directly about support or help with technical issues.</p>
</div>
<div class="section" id="credits">
Expand All @@ -445,7 +445,7 @@ <h2><a class="toc-backref" href="#toc-entry-7">Maintainers</a></h2>
<p>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.</p>
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/web/tree/14.0/web_edit_user_filter">OCA/web</a> project on GitHub.</p>
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/web/tree/15.0/web_edit_user_filter">OCA/web</a> project on GitHub.</p>
<p>You are welcome to contribute. To learn how please visit <a class="reference external" href="https://odoo-community.org/page/Contribute">https://odoo-community.org/page/Contribute</a>.</p>
</div>
</div>
Expand Down
11 changes: 7 additions & 4 deletions web_edit_user_filter/static/src/js/backend.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ odoo.define("web_edit_user_filter/static/src/js/backend.js", function (require)
};

patch(
components.ControlPanelModelExtension,
components.ControlPanelModelExtension.prototype,
"web_edit_user_filter/static/src/js/backend.js",
{
_favoriteToIrFilter(favorite) {
Expand Down Expand Up @@ -46,17 +46,19 @@ odoo.define("web_edit_user_filter/static/src/js/backend.js", function (require)
);

patch(
components.CustomFavoriteItem,
components.CustomFavoriteItem.prototype,
"web_edit_user_filter/static/src/js/backend.js",
{
// ---------------------------------------------------------------------
// Private
// ---------------------------------------------------------------------

/**
* FIXME DRY addons/web/static/src/search/favorite_menu/custom_favorite_item.js
* @override
* @private
*/
_saveFavorite() {
saveFavorite() {
if (!this.state.description.length) {
this.env.services.notification.notify({
message: this.env._t(
Expand All @@ -77,6 +79,7 @@ odoo.define("web_edit_user_filter/static/src/js/backend.js", function (require)
});
return this.descriptionRef.el.focus();
}
// HACK This is the only difference
var facets = this.model.get("facets");
this.model.dispatch("createNewFavorite", {
type: "favorite",
Expand All @@ -96,7 +99,7 @@ odoo.define("web_edit_user_filter/static/src/js/backend.js", function (require)
}
);

patch(components.SearchBar, "web_edit_user_filter/static/src/js/backend.js", {
patch(components.SearchBar.prototype, "web_edit_user_filter/static/src/js/backend.js", {
mounted() {
var self = this;
this._super(...arguments);
Expand Down
45 changes: 4 additions & 41 deletions web_edit_user_filter/static/src/xml/search_extended.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,50 +2,13 @@
<templates id="template" xml:space="preserve">
<t
t-name="SearchExtender"
t-inherit="web.SearchBar"
t-inherit="web.Legacy.SearchBar"
t-inherit-mode="extension"
owl="1"
>
<xpath expr="//div[hasclass('o_searchview_facet')]" position="replace">
<div
t-foreach="model.get('facets')"
t-as="facet"
t-key="facet_index"
tabindex="0"
class="o_searchview_facet"
role="img"
aria-label="search"
t-on-keydown="_onFacetKeydown(facet, facet_index)"
t-att-data-type="facet.type"
t-att-data-gp="facet.groupId"
>
<span
t-if="facet.icon"
t-attf-class="o_searchview_facet_label {{ facet.icon }}"
/>
<span t-else="" class="o_searchview_facet_label" t-esc="facet.title" />
<div class="o_facet_values">
<t
t-foreach="facet.values"
t-as="facetValue"
t-key="facetValue_index"
>
<span
t-if="!facetValue_first"
class="o_facet_values_sep"
t-esc="facet.separator"
/>
<span class="o_facet_value" t-esc="facetValue" />
</t>
</div>
<i
class="fa fa-sm fa-remove o_facet_remove"
role="img"
aria-label="Remove"
title="Remove"
t-on-click="_onFacetRemove(facet)"
/>
</div>
<xpath expr="//div[hasclass('o_searchview_facet')]" position="attributes">
<attribute name="t-att-data-type">facet.type</attribute>
<attribute name="t-att-data-gp">facet.groupId</attribute>
</xpath>
</t>
</templates>
17 changes: 0 additions & 17 deletions web_edit_user_filter/templates/assets.xml

This file was deleted.

0 comments on commit 112f751

Please sign in to comment.