From 88d09ba3096589f058738d76a992330be48e7f4d Mon Sep 17 00:00:00 2001 From: Alexey Pelykh Date: Sun, 12 Apr 2020 08:59:14 +0200 Subject: [PATCH] [MIG] web_widget_dropdown_dynamic: Migration to 13.0 --- web_widget_dropdown_dynamic/README.rst | 15 +++----- web_widget_dropdown_dynamic/__manifest__.py | 4 +-- .../i18n/web_widget_dropdown_dynamic.pot | 9 +++-- .../readme/ROADMAP.rst | 1 - .../static/description/index.html | 35 +++++++------------ .../static/src/js/basic_model.js | 6 ++-- .../web_widget_dropdown_dynamic_tests.js | 12 +++---- 7 files changed, 33 insertions(+), 49 deletions(-) delete mode 100644 web_widget_dropdown_dynamic/readme/ROADMAP.rst diff --git a/web_widget_dropdown_dynamic/README.rst b/web_widget_dropdown_dynamic/README.rst index 21d266392..dd1a738ca 100644 --- a/web_widget_dropdown_dynamic/README.rst +++ b/web_widget_dropdown_dynamic/README.rst @@ -14,13 +14,13 @@ Dynamic Dropdown Widget :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/12.0/web_widget_dropdown_dynamic + :target: https://github.com/OCA/web/tree/13.0/web_widget_dropdown_dynamic :alt: OCA/web .. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png - :target: https://translation.odoo-community.org/projects/web-12-0/web-12-0-web_widget_dropdown_dynamic + :target: https://translation.odoo-community.org/projects/web-13-0/web-13-0-web_widget_dropdown_dynamic :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/12.0 + :target: https://runbot.odoo-community.org/runbot/162/13.0 :alt: Try me on Runbot |badge1| |badge2| |badge3| |badge4| |badge5| @@ -68,18 +68,13 @@ Usage context="{'depending_on': other_field}" /> -Known issues / Roadmap -====================== - - * In v13, ``$.when`` is going to become `Promise.resolve` - 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. @@ -109,6 +104,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_dropdown_dynamic/__manifest__.py b/web_widget_dropdown_dynamic/__manifest__.py index 8a47e74b2..79edb4045 100644 --- a/web_widget_dropdown_dynamic/__manifest__.py +++ b/web_widget_dropdown_dynamic/__manifest__.py @@ -1,10 +1,10 @@ -# Copyright 2019 Brainbean Apps (https://brainbeanapps.com) +# Copyright 2019-2020 Brainbean Apps (https://brainbeanapps.com) # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). { "name": "Dynamic Dropdown Widget", "summary": "This module adds support for dynamic dropdown widget", "category": "Web", - "version": "12.0.1.0.0", + "version": "13.0.1.0.0", "license": "AGPL-3", "author": "Brainbean Apps OU, Odoo Community Association (OCA)", "website": "https://github.com/OCA/web/", diff --git a/web_widget_dropdown_dynamic/i18n/web_widget_dropdown_dynamic.pot b/web_widget_dropdown_dynamic/i18n/web_widget_dropdown_dynamic.pot index 673c92c99..1472b629c 100644 --- a/web_widget_dropdown_dynamic/i18n/web_widget_dropdown_dynamic.pot +++ b/web_widget_dropdown_dynamic/i18n/web_widget_dropdown_dynamic.pot @@ -1,12 +1,12 @@ # Translation of Odoo Server. # This file contains the translation of the following modules: -# * web_widget_dropdown_dynamic +# * web_widget_dropdown_dynamic # msgid "" msgstr "" -"Project-Id-Version: Odoo Server 12.0\n" +"Project-Id-Version: Odoo Server 13.0\n" "Report-Msgid-Bugs-To: \n" -"Last-Translator: <>\n" +"Last-Translator: \n" "Language-Team: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" @@ -15,8 +15,7 @@ msgstr "" #. module: web_widget_dropdown_dynamic #. openerp-web -#: code:addons/web_widget_dropdown_dynamic/static/src/js/field_dynamic_dropdown.js:15 +#: code:addons/web_widget_dropdown_dynamic/static/src/js/field_dynamic_dropdown.js:0 #, python-format msgid "Dynamic Dropdown" msgstr "" - diff --git a/web_widget_dropdown_dynamic/readme/ROADMAP.rst b/web_widget_dropdown_dynamic/readme/ROADMAP.rst deleted file mode 100644 index 7186b62cf..000000000 --- a/web_widget_dropdown_dynamic/readme/ROADMAP.rst +++ /dev/null @@ -1 +0,0 @@ - * In v13, ``$.when`` is going to become `Promise.resolve` diff --git a/web_widget_dropdown_dynamic/static/description/index.html b/web_widget_dropdown_dynamic/static/description/index.html index d17e254a2..88600c245 100644 --- a/web_widget_dropdown_dynamic/static/description/index.html +++ b/web_widget_dropdown_dynamic/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

Dynamic dropdown widget that supports resolving options from backend of:

    @@ -383,12 +383,11 @@ instead.

    -
    -

    Known issues / Roadmap

    -
    -
      -
    • In v13, $.when is going to become Promise.resolve
    • -
    -
    -
    -

    Bug Tracker

    +

    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.

    -

    Credits

    +

    Credits

    -

    Authors

    +

    Authors

    • Brainbean Apps OU
    -

    Maintainers

    +

    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.

    +

    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_dropdown_dynamic/static/src/js/basic_model.js b/web_widget_dropdown_dynamic/static/src/js/basic_model.js index dbdfb4f23..f5b211e2c 100644 --- a/web_widget_dropdown_dynamic/static/src/js/basic_model.js +++ b/web_widget_dropdown_dynamic/static/src/js/basic_model.js @@ -1,5 +1,5 @@ /* - * Copyright 2019 Brainbean Apps (https://brainbeanapps.com) + * Copyright 2019-2020 Brainbean Apps (https://brainbeanapps.com) * License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). */ odoo.define("web_widget_dropdown_dynamic.basic_model", function(require) { @@ -24,7 +24,7 @@ odoo.define("web_widget_dropdown_dynamic.basic_model", function(require) { var model = fieldInfo.options.model || record.model; var method = fieldInfo.values || fieldInfo.options.values; if (!method) { - return $.when(); + return Promise.resolve(); } var context = record.getContext({fieldName: fieldName}); @@ -34,7 +34,7 @@ odoo.define("web_widget_dropdown_dynamic.basic_model", function(require) { context: context, }); if (!hasChanged) { - return $.when(); + return Promise.resolve(); } return this._rpc({ diff --git a/web_widget_dropdown_dynamic/static/tests/web_widget_dropdown_dynamic_tests.js b/web_widget_dropdown_dynamic/static/tests/web_widget_dropdown_dynamic_tests.js index 615534d79..f51b619cd 100644 --- a/web_widget_dropdown_dynamic/static/tests/web_widget_dropdown_dynamic_tests.js +++ b/web_widget_dropdown_dynamic/static/tests/web_widget_dropdown_dynamic_tests.js @@ -29,7 +29,7 @@ odoo.define("web_widget_dropdown_dynamic.web_widget_dropdown_dynamic_tests", fun "", mockRPC: function(route, args) { if (args.method === "_get_test_field_values") { - return $.when([["value", "Title"]]); + return Promise.resolve([["value", "Title"]]); } return this._super.apply(this, arguments); }, @@ -61,7 +61,7 @@ odoo.define("web_widget_dropdown_dynamic.web_widget_dropdown_dynamic_tests", fun "", mockRPC: function(route, args) { if (args.method === "_get_test_field_values") { - return $.when([[0, "Title"]]); + return Promise.resolve([[0, "Title"]]); } return this._super.apply(this, arguments); }, @@ -95,7 +95,7 @@ odoo.define("web_widget_dropdown_dynamic.web_widget_dropdown_dynamic_tests", fun "", mockRPC: function(route, args) { if (args.method === "_get_test_field_values") { - return $.when([["value", "Title"]]); + return Promise.resolve([["value", "Title"]]); } return this._super.apply(this, arguments); }, @@ -130,14 +130,14 @@ odoo.define("web_widget_dropdown_dynamic.web_widget_dropdown_dynamic_tests", fun mockRPC: function(route, args) { if (args.method === "_get_test_field_values") { if (args.kwargs.context.step === "step-1") { - return $.when([["value", "Title"]]); + return Promise.resolve([["value", "Title"]]); } else if (args.kwargs.context.step === "step-2") { - return $.when([ + return Promise.resolve([ ["value", "Title"], ["value_2", "Title 2"], ]); } - return $.when([]); + return Promise.resolve([]); } return this._super.apply(this, arguments); },