[MIG] web_ir_actions_act_multi: Migration to 13.0

pull/3134/head
Manuel Calero 2020-02-25 11:36:40 +01:00 committed by David
parent bc5f5d3bc2
commit 04b9fe0a06
6 changed files with 26 additions and 30 deletions

View File

@ -14,13 +14,13 @@ Web Actions Multi
:target: http://www.gnu.org/licenses/lgpl-3.0-standalone.html :target: http://www.gnu.org/licenses/lgpl-3.0-standalone.html
:alt: License: LGPL-3 :alt: License: LGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fweb-lightgray.png?logo=github .. |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 :alt: OCA/web
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png .. |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 :alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png .. |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 :alt: Try me on Runbot
|badge1| |badge2| |badge3| |badge4| |badge5| |badge1| |badge2| |badge3| |badge4| |badge5|
@ -56,7 +56,7 @@ Bug Tracker
Bugs are tracked on `GitHub Issues <https://github.com/OCA/web/issues>`_. 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. 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 If you spotted it first, help us smashing it by providing a detailed and welcomed
`feedback <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 <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**>`_.
Do not contact contributors directly about support or help with technical issues. Do not contact contributors directly about support or help with technical issues.
@ -75,6 +75,7 @@ Contributors
* Petar Najman <petar.najman@modoolar.com> * Petar Najman <petar.najman@modoolar.com>
* Mladen Meseldzija <mladen.meseldzija@modoolar.com> * Mladen Meseldzija <mladen.meseldzija@modoolar.com>
* Alexey Pelykh <alexey.pelykh@brainbeanapps.com> * Alexey Pelykh <alexey.pelykh@brainbeanapps.com>
* Manuel Calero - Tecnativa
Maintainers 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 mission is to support the collaborative development of Odoo features and
promote its widespread use. promote its widespread use.
This module is part of the `OCA/web <https://github.com/OCA/web/tree/12.0/web_ir_actions_act_multi>`_ project on GitHub. This module is part of the `OCA/web <https://github.com/OCA/web/tree/13.0/web_ir_actions_act_multi>`_ project on GitHub.
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

View File

@ -3,12 +3,11 @@
# #
msgid "" msgid ""
msgstr "" msgstr ""
"Project-Id-Version: Odoo Server 12.0\n" "Project-Id-Version: Odoo Server 13.0\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"Last-Translator: <>\n" "Last-Translator: \n"
"Language-Team: \n" "Language-Team: \n"
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n" "Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n" "Content-Transfer-Encoding: \n"
"Plural-Forms: \n" "Plural-Forms: \n"

View File

@ -1,3 +1,4 @@
* Petar Najman <petar.najman@modoolar.com> * Petar Najman <petar.najman@modoolar.com>
* Mladen Meseldzija <mladen.meseldzija@modoolar.com> * Mladen Meseldzija <mladen.meseldzija@modoolar.com>
* Alexey Pelykh <alexey.pelykh@brainbeanapps.com> * Alexey Pelykh <alexey.pelykh@brainbeanapps.com>
* Manuel Calero - Tecnativa

View File

@ -367,7 +367,7 @@ ul.auto-toc {
!! This file is generated by oca-gen-addon-readme !! !! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !! !! 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>This module provides a way to trigger more than one action on ActionManager</p>
<p><strong>Table of contents</strong></p> <p><strong>Table of contents</strong></p>
<div class="contents local topic" id="contents"> <div class="contents local topic" id="contents">
@ -386,7 +386,7 @@ ul.auto-toc {
<h1><a class="toc-backref" href="#id1">Usage</a></h1> <h1><a class="toc-backref" href="#id1">Usage</a></h1>
<p>To use this functionality you need to return following action with list of actions to execute:</p> <p>To use this functionality you need to return following action with list of actions to execute:</p>
<pre class="code python literal-block"> <pre class="code python literal-block">
<span class="nd">&#64;api.multi</span> <span class="nd">&#64;api</span><span class="o">.</span><span class="n">multi</span>
<span class="k">def</span> <span class="nf">foo</span><span class="p">():</span> <span class="k">def</span> <span class="nf">foo</span><span class="p">():</span>
<span class="bp">self</span><span class="o">.</span><span class="n">ensure_one</span><span class="p">()</span> <span class="bp">self</span><span class="o">.</span><span class="n">ensure_one</span><span class="p">()</span>
<span class="k">return</span> <span class="p">{</span> <span class="k">return</span> <span class="p">{</span>
@ -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>. <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. 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 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> <p>Do not contact contributors directly about support or help with technical issues.</p>
</div> </div>
<div class="section" id="credits"> <div class="section" id="credits">
@ -421,6 +421,7 @@ If you spotted it first, help us smashing it by providing a detailed and welcome
<li>Petar Najman &lt;<a class="reference external" href="mailto:petar.najman&#64;modoolar.com">petar.najman&#64;modoolar.com</a>&gt;</li> <li>Petar Najman &lt;<a class="reference external" href="mailto:petar.najman&#64;modoolar.com">petar.najman&#64;modoolar.com</a>&gt;</li>
<li>Mladen Meseldzija &lt;<a class="reference external" href="mailto:mladen.meseldzija&#64;modoolar.com">mladen.meseldzija&#64;modoolar.com</a>&gt;</li> <li>Mladen Meseldzija &lt;<a class="reference external" href="mailto:mladen.meseldzija&#64;modoolar.com">mladen.meseldzija&#64;modoolar.com</a>&gt;</li>
<li>Alexey Pelykh &lt;<a class="reference external" href="mailto:alexey.pelykh&#64;brainbeanapps.com">alexey.pelykh&#64;brainbeanapps.com</a>&gt;</li> <li>Alexey Pelykh &lt;<a class="reference external" href="mailto:alexey.pelykh&#64;brainbeanapps.com">alexey.pelykh&#64;brainbeanapps.com</a>&gt;</li>
<li>Manuel Calero - Tecnativa</li>
</ul> </ul>
</div> </div>
<div class="section" id="maintainers"> <div class="section" id="maintainers">
@ -430,7 +431,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 <p>OCA, or the Odoo Community Association, is a nonprofit organization whose
mission is to support the collaborative development of Odoo features and mission is to support the collaborative development of Odoo features and
promote its widespread use.</p> 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> <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>
</div> </div>

View File

@ -1,5 +1,6 @@
// Copyright 2017 - 2018 Modoolar <info@modoolar.com> // Copyright 2017 - 2018 Modoolar <info@modoolar.com>
// Copyright 2018 Brainbean Apps <hello@brainbeanapps.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). // 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) { 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") { if (action.type === "ir.actions.act_multi") {
return this._executeMultiAction(action, options); return this._executeMultiAction(action, options);
} }
return this._super.apply(this, arguments); 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 * Handle 'ir.actions.act_multi' action
* @param {Object} action see _handleAction() parameters * @param {Object} action see _handleAction() parameters
* @param {Object} options see _handleAction() parameters * @param {Object} options see _handleAction() parameters
* @param {integer|undefined} index Index of action being handled
* @returns {$.Promise} * @returns {$.Promise}
*/ */
_executeMultiAction: function(action, options, index) { _executeMultiAction: function(action, options) {
var self = this; const self = this;
if (index === undefined) { return action.actions
index = 0; // eslint-disable-line no-param-reassign .map(item => {
} return () => {
return self._handleAction(item, options);
if (index === action.actions.length - 1) { };
return this._handleAction(action.actions[index], options); })
} else if (index >= action.actions.length) { .reduce((prev, cur) => {
return $.when(); return prev.then(cur);
} }, Promise.resolve());
return this._handleAction(action.actions[index], options).then(function() {
return self._executeMultiAction(action, options, index + 1);
});
}, },
}); });
}); });

View File

@ -10,7 +10,6 @@
inherit_id="web.assets_backend" inherit_id="web.assets_backend"
> >
<xpath expr="." position="inside"> <xpath expr="." position="inside">
<script <script
type="text/javascript" type="text/javascript"
src="/web_ir_actions_act_multi/static/src/js/web_ir_actions_act_multi.js" src="/web_ir_actions_act_multi/static/src/js/web_ir_actions_act_multi.js"