forked from Techsystech/web
[MIG] web_ir_actions_act_multi: Migration to 13.0
parent
2848c8f1d6
commit
7964799a8a
|
@ -1,3 +1,4 @@
|
|||
* Petar Najman <petar.najman@modoolar.com>
|
||||
* Mladen Meseldzija <mladen.meseldzija@modoolar.com>
|
||||
* Alexey Pelykh <alexey.pelykh@brainbeanapps.com>
|
||||
* Manuel Calero - Tecnativa
|
||||
|
|
|
@ -367,7 +367,7 @@ ul.auto-toc {
|
|||
!! This file is generated by oca-gen-addon-readme !!
|
||||
!! changes will be overwritten. !!
|
||||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
|
||||
<p><a class="reference external" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external" href="http://www.gnu.org/licenses/lgpl-3.0-standalone.html"><img alt="License: LGPL-3" src="https://img.shields.io/badge/licence-LGPL--3-blue.png" /></a> <a class="reference external" href="https://github.com/OCA/web/tree/12.0/web_ir_actions_act_multi"><img alt="OCA/web" src="https://img.shields.io/badge/github-OCA%2Fweb-lightgray.png?logo=github" /></a> <a class="reference external" href="https://translation.odoo-community.org/projects/web-12-0/web-12-0-web_ir_actions_act_multi"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external" href="https://runbot.odoo-community.org/runbot/162/12.0"><img alt="Try me on Runbot" src="https://img.shields.io/badge/runbot-Try%20me-875A7B.png" /></a></p>
|
||||
<p><a class="reference external" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external" href="http://www.gnu.org/licenses/lgpl-3.0-standalone.html"><img alt="License: LGPL-3" src="https://img.shields.io/badge/licence-LGPL--3-blue.png" /></a> <a class="reference external" href="https://github.com/OCA/web/tree/13.0/web_ir_actions_act_multi"><img alt="OCA/web" src="https://img.shields.io/badge/github-OCA%2Fweb-lightgray.png?logo=github" /></a> <a class="reference external" href="https://translation.odoo-community.org/projects/web-13-0/web-13-0-web_ir_actions_act_multi"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external" href="https://runbot.odoo-community.org/runbot/162/13.0"><img alt="Try me on Runbot" src="https://img.shields.io/badge/runbot-Try%20me-875A7B.png" /></a></p>
|
||||
<p>This module provides a way to trigger more than one action on ActionManager</p>
|
||||
<p><strong>Table of contents</strong></p>
|
||||
<div class="contents local topic" id="contents">
|
||||
|
@ -403,7 +403,7 @@ ul.auto-toc {
|
|||
<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 smashing it by providing a detailed and welcomed
|
||||
<a class="reference external" href="https://github.com/OCA/web/issues/new?body=module:%20web_ir_actions_act_multi%0Aversion:%2012.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_ir_actions_act_multi%0Aversion:%2013.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">
|
||||
|
@ -430,7 +430,7 @@ If you spotted it first, help us smashing it by providing a detailed and welcome
|
|||
<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/12.0/web_ir_actions_act_multi">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/13.0/web_ir_actions_act_multi">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>
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
// Copyright 2017 - 2018 Modoolar <info@modoolar.com>
|
||||
// Copyright 2018 Brainbean Apps <hello@brainbeanapps.com>
|
||||
// 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());
|
||||
},
|
||||
});
|
||||
});
|
||||
|
|
|
@ -10,7 +10,6 @@
|
|||
inherit_id="web.assets_backend"
|
||||
>
|
||||
<xpath expr="." position="inside">
|
||||
|
||||
<script
|
||||
type="text/javascript"
|
||||
src="/web_ir_actions_act_multi/static/src/js/web_ir_actions_act_multi.js"
|
||||
|
|
Loading…
Reference in New Issue