mirror of https://github.com/OCA/web.git
[IMP] web_ir_actions_act_multi: black, isort
parent
bc3d948aca
commit
57efcc1a28
|
@ -1,22 +1,17 @@
|
||||||
# Copyright 2017 - 2018 Modoolar <info@modoolar.com>
|
# Copyright 2017 - 2018 Modoolar <info@modoolar.com>
|
||||||
# Copyright 2018 Brainbean Apps
|
# Copyright 2018 Brainbean Apps
|
||||||
|
# Copyright 2020 Manuel Calero
|
||||||
# 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).
|
||||||
|
|
||||||
{
|
{
|
||||||
"name": "Web Actions Multi",
|
"name": "Web Actions Multi",
|
||||||
"summary": "Enables triggering of more than one action on ActionManager",
|
"summary": "Enables triggering of more than one action on ActionManager",
|
||||||
"category": "Web",
|
"category": "Web",
|
||||||
"version": "12.0.1.0.0",
|
"version": "13.0.1.0.0",
|
||||||
"license": "LGPL-3",
|
"license": "LGPL-3",
|
||||||
"author": "Modoolar, "
|
"author": "Modoolar, " "Brainbean Apps, " "Odoo Community Association (OCA)",
|
||||||
"Brainbean Apps, "
|
|
||||||
"Odoo Community Association (OCA)",
|
|
||||||
"website": "https://github.com/OCA/web/",
|
"website": "https://github.com/OCA/web/",
|
||||||
"depends": [
|
"depends": ["web"],
|
||||||
"web"
|
"data": ["views/web_ir_actions_act_multi.xml"],
|
||||||
],
|
|
||||||
"data": [
|
|
||||||
"views/web_ir_actions_act_multi.xml",
|
|
||||||
],
|
|
||||||
"installable": True,
|
"installable": True,
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,19 +2,18 @@
|
||||||
// Copyright 2018 Brainbean Apps <hello@brainbeanapps.com>
|
// Copyright 2018 Brainbean Apps <hello@brainbeanapps.com>
|
||||||
// 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) {
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
var ActionManager = require('web.ActionManager');
|
var ActionManager = require("web.ActionManager");
|
||||||
|
|
||||||
ActionManager.include({
|
ActionManager.include({
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Intercept action handling to detect extra action type
|
* Intercept action handling to detect extra action type
|
||||||
* @override
|
* @override
|
||||||
*/
|
*/
|
||||||
_handleAction: function (action, options) {
|
_handleAction: function(action, options) {
|
||||||
if (action.type === 'ir.actions.act_multi') {
|
if (action.type === "ir.actions.act_multi") {
|
||||||
return this._executeMultiAction(action, options);
|
return this._executeMultiAction(action, options);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -28,7 +27,7 @@ odoo.define('web_ir_actions_act_multi.ir_actions_act_multi', function (require)
|
||||||
* @param {integer|undefined} index Index of action being handled
|
* @param {integer|undefined} index Index of action being handled
|
||||||
* @returns {$.Promise}
|
* @returns {$.Promise}
|
||||||
*/
|
*/
|
||||||
_executeMultiAction: function (action, options, index) {
|
_executeMultiAction: function(action, options, index) {
|
||||||
var self = this;
|
var self = this;
|
||||||
|
|
||||||
if (index === undefined) {
|
if (index === undefined) {
|
||||||
|
@ -41,13 +40,9 @@ odoo.define('web_ir_actions_act_multi.ir_actions_act_multi', function (require)
|
||||||
return $.when();
|
return $.when();
|
||||||
}
|
}
|
||||||
|
|
||||||
return this
|
return this._handleAction(action.actions[index], options).then(function() {
|
||||||
._handleAction(action.actions[index], options)
|
return self._executeMultiAction(action, options, index + 1);
|
||||||
.then(function () {
|
});
|
||||||
return self._executeMultiAction(action, options, index + 1);
|
|
||||||
});
|
|
||||||
},
|
},
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
|
@ -1,14 +1,20 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8" ?>
|
||||||
<!--
|
<!--
|
||||||
# Copyright 2017 - 2018 Modoolar <info@modoolar.com>
|
# Copyright 2017 - 2018 Modoolar <info@modoolar.com>
|
||||||
# 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>
|
<odoo>
|
||||||
<template id="assets_backend" name="web_ir_actions_act_multi assets" inherit_id="web.assets_backend">
|
<template
|
||||||
|
id="assets_backend"
|
||||||
|
name="web_ir_actions_act_multi assets"
|
||||||
|
inherit_id="web.assets_backend"
|
||||||
|
>
|
||||||
<xpath expr="." position="inside">
|
<xpath expr="." position="inside">
|
||||||
|
|
||||||
<script type="text/javascript"
|
<script
|
||||||
src="/web_ir_actions_act_multi/static/src/js/web_ir_actions_act_multi.js" />
|
type="text/javascript"
|
||||||
|
src="/web_ir_actions_act_multi/static/src/js/web_ir_actions_act_multi.js"
|
||||||
|
/>
|
||||||
</xpath>
|
</xpath>
|
||||||
</template>
|
</template>
|
||||||
</odoo>
|
</odoo>
|
||||||
|
|
Loading…
Reference in New Issue