diff --git a/web_ir_actions_act_multi/README.rst b/web_ir_actions_act_multi/README.rst index 152a36159..439e3116a 100644 --- a/web_ir_actions_act_multi/README.rst +++ b/web_ir_actions_act_multi/README.rst @@ -14,13 +14,13 @@ Web Actions Multi :target: http://www.gnu.org/licenses/lgpl-3.0-standalone.html :alt: License: LGPL-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_ir_actions_act_multi + :target: https://github.com/OCA/web/tree/13.0/web_ir_actions_act_multi :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_ir_actions_act_multi + :target: https://translation.odoo-community.org/projects/web-13-0/web-13-0-web_ir_actions_act_multi :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| @@ -56,7 +56,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. @@ -75,6 +75,7 @@ Contributors * Petar Najman * Mladen Meseldzija * Alexey Pelykh +* Manuel Calero - Tecnativa Maintainers ~~~~~~~~~~~ @@ -89,6 +90,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_ir_actions_act_multi/i18n/web_ir_actions_act_multi.pot b/web_ir_actions_act_multi/i18n/web_ir_actions_act_multi.pot index d2e396f15..cc93d01ee 100644 --- a/web_ir_actions_act_multi/i18n/web_ir_actions_act_multi.pot +++ b/web_ir_actions_act_multi/i18n/web_ir_actions_act_multi.pot @@ -3,12 +3,11 @@ # 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" "Content-Transfer-Encoding: \n" "Plural-Forms: \n" - diff --git a/web_ir_actions_act_multi/readme/CONTRIBUTORS.rst b/web_ir_actions_act_multi/readme/CONTRIBUTORS.rst index 0bb36955d..8d2303eb5 100644 --- a/web_ir_actions_act_multi/readme/CONTRIBUTORS.rst +++ b/web_ir_actions_act_multi/readme/CONTRIBUTORS.rst @@ -1,3 +1,4 @@ * Petar Najman * Mladen Meseldzija * Alexey Pelykh +* Manuel Calero - Tecnativa diff --git a/web_ir_actions_act_multi/static/description/index.html b/web_ir_actions_act_multi/static/description/index.html index 22eb24b4d..613d6ada4 100644 --- a/web_ir_actions_act_multi/static/description/index.html +++ b/web_ir_actions_act_multi/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: LGPL-3 OCA/web Translate me on Weblate Try me on Runbot

+

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

This module provides a way to trigger more than one action on ActionManager

Table of contents

@@ -386,7 +386,7 @@ ul.auto-toc {

Usage

To use this functionality you need to return following action with list of actions to execute:

-@api.multi
+@api.multi
 def foo():
    self.ensure_one()
    return {
@@ -403,7 +403,7 @@ ul.auto-toc {
 

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.

@@ -421,6 +421,7 @@ If you spotted it first, help us smashing it by providing a detailed and welcome
  • Petar Najman <petar.najman@modoolar.com>
  • Mladen Meseldzija <mladen.meseldzija@modoolar.com>
  • Alexey Pelykh <alexey.pelykh@brainbeanapps.com>
  • +
  • Manuel Calero - Tecnativa
  • @@ -430,7 +431,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_ir_actions_act_multi/static/src/js/web_ir_actions_act_multi.js b/web_ir_actions_act_multi/static/src/js/web_ir_actions_act_multi.js index cadea60ec..5905ebca0 100644 --- a/web_ir_actions_act_multi/static/src/js/web_ir_actions_act_multi.js +++ b/web_ir_actions_act_multi/static/src/js/web_ir_actions_act_multi.js @@ -1,5 +1,6 @@ // Copyright 2017 - 2018 Modoolar // Copyright 2018 Brainbean Apps +// Copyright 2020 Manuel Calero - Tecnativa // License LGPLv3.0 or later (https://www.gnu.org/licenses/lgpl-3.0.en.html). odoo.define("web_ir_actions_act_multi.ir_actions_act_multi", function(require) { @@ -16,7 +17,6 @@ odoo.define("web_ir_actions_act_multi.ir_actions_act_multi", function(require) { if (action.type === "ir.actions.act_multi") { return this._executeMultiAction(action, options); } - return this._super.apply(this, arguments); }, @@ -24,25 +24,20 @@ odoo.define("web_ir_actions_act_multi.ir_actions_act_multi", function(require) { * Handle 'ir.actions.act_multi' action * @param {Object} action see _handleAction() parameters * @param {Object} options see _handleAction() parameters - * @param {integer|undefined} index Index of action being handled * @returns {$.Promise} */ - _executeMultiAction: function(action, options, index) { - var self = this; + _executeMultiAction: function(action, options) { + const self = this; - if (index === undefined) { - index = 0; // eslint-disable-line no-param-reassign - } - - if (index === action.actions.length - 1) { - return this._handleAction(action.actions[index], options); - } else if (index >= action.actions.length) { - return $.when(); - } - - return this._handleAction(action.actions[index], options).then(function() { - return self._executeMultiAction(action, options, index + 1); - }); + return action.actions + .map(item => { + return () => { + return self._handleAction(item, options); + }; + }) + .reduce((prev, cur) => { + return prev.then(cur); + }, Promise.resolve()); }, }); }); diff --git a/web_ir_actions_act_multi/views/web_ir_actions_act_multi.xml b/web_ir_actions_act_multi/views/web_ir_actions_act_multi.xml index 7c45bcbc4..ada8cb618 100644 --- a/web_ir_actions_act_multi/views/web_ir_actions_act_multi.xml +++ b/web_ir_actions_act_multi/views/web_ir_actions_act_multi.xml @@ -10,7 +10,6 @@ inherit_id="web.assets_backend" > -