From 674b6488061684af80db015facf42ef4d55e963b Mon Sep 17 00:00:00 2001 From: Carlos Lopez Date: Thu, 27 Jan 2022 02:06:23 -0500 Subject: [PATCH] [MIG] web_widget_domain_editor_dialog: Migration to 15.0 --- web_widget_domain_editor_dialog/README.rst | 13 +++++++------ web_widget_domain_editor_dialog/__manifest__.py | 8 ++++++-- .../readme/CONTRIBUTORS.rst | 1 + .../static/description/index.html | 9 +++++---- .../static/src/js/basic_fields.js | 13 +++++++------ .../static/src/js/widget_domain_editor_dialog.js | 14 ++++++-------- .../views/templates.xml | 15 --------------- 7 files changed, 32 insertions(+), 41 deletions(-) delete mode 100644 web_widget_domain_editor_dialog/views/templates.xml diff --git a/web_widget_domain_editor_dialog/README.rst b/web_widget_domain_editor_dialog/README.rst index fc41c9665..fe8b1f9d7 100644 --- a/web_widget_domain_editor_dialog/README.rst +++ b/web_widget_domain_editor_dialog/README.rst @@ -14,13 +14,13 @@ Web Widget Domain Editor Dialog :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_widget_domain_editor_dialog + :target: https://github.com/OCA/web/tree/15.0/web_widget_domain_editor_dialog :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_widget_domain_editor_dialog + :target: https://translation.odoo-community.org/projects/web-15-0/web-15-0-web_widget_domain_editor_dialog :alt: Translate me on Weblate .. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png - :target: https://runbot.odoo-community.org/runbot/162/14.0 + :target: https://runbot.odoo-community.org/runbot/162/15.0 :alt: Try me on Runbot |badge1| |badge2| |badge3| |badge4| |badge5| @@ -57,7 +57,7 @@ with a user filter: You can still edit the filter with Odoo's widget after that. -.. figure:: https://raw.githubusercontent.com/OCA/web/14.0/web_widget_domain_editor_dialog/static/src/img/behaviour.gif +.. figure:: https://raw.githubusercontent.com/OCA/web/15.0/web_widget_domain_editor_dialog/static/src/img/behaviour.gif :align: center :width: 600 px @@ -67,7 +67,7 @@ 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 smashing it by providing a detailed and welcomed -`feedback `_. +`feedback `_. Do not contact contributors directly about support or help with technical issues. @@ -90,6 +90,7 @@ Contributors * Darshan Patel * Helly kapatel +* Carlos Lopez Maintainers ~~~~~~~~~~~ @@ -104,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 `_ project on GitHub. +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. diff --git a/web_widget_domain_editor_dialog/__manifest__.py b/web_widget_domain_editor_dialog/__manifest__.py index 04e70708e..1d08c2453 100644 --- a/web_widget_domain_editor_dialog/__manifest__.py +++ b/web_widget_domain_editor_dialog/__manifest__.py @@ -3,12 +3,16 @@ { "name": "Web Widget Domain Editor Dialog", "summary": "Recovers the Domain Editor Dialog functionality", - "version": "14.0.1.0.0", + "version": "15.0.1.0.0", "category": "Web", "author": "Tecnativa," "Odoo Community Association (OCA)", "website": "https://github.com/OCA/web", "license": "AGPL-3", "depends": ["web"], - "data": ["views/templates.xml"], + "assets": { + "web.assets_backend": [ + "/web_widget_domain_editor_dialog/static/src/js/*.js", + ], + }, "installable": True, } diff --git a/web_widget_domain_editor_dialog/readme/CONTRIBUTORS.rst b/web_widget_domain_editor_dialog/readme/CONTRIBUTORS.rst index d70bcb090..274c293d4 100644 --- a/web_widget_domain_editor_dialog/readme/CONTRIBUTORS.rst +++ b/web_widget_domain_editor_dialog/readme/CONTRIBUTORS.rst @@ -6,3 +6,4 @@ * Darshan Patel * Helly kapatel +* Carlos Lopez diff --git a/web_widget_domain_editor_dialog/static/description/index.html b/web_widget_domain_editor_dialog/static/description/index.html index a783b2d9f..9ecd82fcf 100644 --- a/web_widget_domain_editor_dialog/static/description/index.html +++ b/web_widget_domain_editor_dialog/static/description/index.html @@ -367,7 +367,7 @@ ul.auto-toc { !! This file is generated by oca-gen-addon-readme !! !! changes will be overwritten. !! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! --> -

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

+

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

Since v11 introduced the new domain editor widget it’s not possible to edit the selected records from the current domain.

This module reintroduces that dialog to complement the current widget with the @@ -408,7 +408,7 @@ records and those unfolded groups will be set as filters to.

You can still edit the filter with Odoo’s widget after that.

-https://raw.githubusercontent.com/OCA/web/14.0/web_widget_domain_editor_dialog/static/src/img/behaviour.gif +https://raw.githubusercontent.com/OCA/web/15.0/web_widget_domain_editor_dialog/static/src/img/behaviour.gif
@@ -416,7 +416,7 @@ records and those unfolded groups will be set as filters to.

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 smashing it by providing a detailed and welcomed -feedback.

+feedback.

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

@@ -438,6 +438,7 @@ If you spotted it first, help us smashing it by providing a detailed and welcome
  • Darshan Patel <darshan.barcelona@gmail.com>
  • Helly kapatel <helly.kapatel@initos.com>
  • +
  • Carlos Lopez <celm1990@gmail.com>
  • @@ -447,7 +448,7 @@ If you spotted it first, help us smashing it by providing a detailed and welcome

    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.

    +

    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.

    diff --git a/web_widget_domain_editor_dialog/static/src/js/basic_fields.js b/web_widget_domain_editor_dialog/static/src/js/basic_fields.js index 1070dcf87..f7e55fff2 100644 --- a/web_widget_domain_editor_dialog/static/src/js/basic_fields.js +++ b/web_widget_domain_editor_dialog/static/src/js/basic_fields.js @@ -4,12 +4,11 @@ odoo.define("web_widget_domain_editor_dialog.basic_fields", function (require) { "use strict"; - const core = require("web.core"); - const basic_fields = require("web.basic_fields"); + const {_t} = require("web.core"); + const {FieldDomain} = require("web.basic_fields"); const DomainEditorDialog = require("web_widget_domain_editor_dialog.DomainEditorDialog"); - const _t = core._t; - basic_fields.FieldDomain.include({ + FieldDomain.include({ _onShowSelectionButtonClick: function (event) { event.preventDefault(); const _this = this; @@ -30,9 +29,11 @@ odoo.define("web_widget_domain_editor_dialog.basic_fields", function (require) { _this.domainSelector .setDomain(this.get_domain(selected_ids)) .then(_this._replaceContent.bind(_this)); - _this.trigger_up("domain_changed", { + // Trigger from domainSelector instead of _this + // for execute https://github.com/odoo/odoo/blob/15.0/addons/web/static/src/legacy/js/widgets/domain_selector.js#L623 + _this.domainSelector.trigger_up("domain_changed", { child: _this, - alreadyRedrawn: true, + noRedraw: true, }); }, }).open(); diff --git a/web_widget_domain_editor_dialog/static/src/js/widget_domain_editor_dialog.js b/web_widget_domain_editor_dialog/static/src/js/widget_domain_editor_dialog.js index ff30b96e8..f48c8abca 100644 --- a/web_widget_domain_editor_dialog/static/src/js/widget_domain_editor_dialog.js +++ b/web_widget_domain_editor_dialog/static/src/js/widget_domain_editor_dialog.js @@ -4,21 +4,19 @@ odoo.define("web_widget_domain_editor_dialog.DomainEditorDialog", function (require) { "use strict"; - const core = require("web.core"); - const view_dialogs = require("web.view_dialogs"); + const {_t} = require("web.core"); + const {SelectCreateDialog} = require("web.view_dialogs"); const Domain = require("web.Domain"); - const _t = core._t; - const DomainEditorDialog = view_dialogs.SelectCreateDialog.extend({ + const DomainEditorDialog = SelectCreateDialog.extend({ init: function () { this._super.apply(this, arguments); - const _this = this; this.options = _.defaults(this.options, { dynamicFilters: [ { - description: _.str.sprintf(_t("Selected domain")), + description: _t("Selected domain"), domain: Domain.prototype.stringToArray( - _this.options.default_domain + this.options.default_domain ), }, ], @@ -62,7 +60,7 @@ odoo.define("web_widget_domain_editor_dialog.DomainEditorDialog", function (requ return domain.concat(group_domain); }, - on_view_list_loaded: () => { + on_view_list_loaded: function () { this.$(".o_list_record_selector input").prop("checked", true); this.$footer .find(".o_selectcreatepopup_search_select") diff --git a/web_widget_domain_editor_dialog/views/templates.xml b/web_widget_domain_editor_dialog/views/templates.xml deleted file mode 100644 index d54d58614..000000000 --- a/web_widget_domain_editor_dialog/views/templates.xml +++ /dev/null @@ -1,15 +0,0 @@ - - -