Browse Source

Add module web_ir_actions_act_multi

pull/1174/head
Petar Najman 6 years ago
committed by Holger Brunn
parent
commit
4cecb791ac
  1. 60
      web_ir_actions_act_multi/README.rst
  2. 0
      web_ir_actions_act_multi/__init__.py
  3. 17
      web_ir_actions_act_multi/__manifest__.py
  4. BIN
      web_ir_actions_act_multi/static/description/icon.png
  5. 31
      web_ir_actions_act_multi/static/src/js/web_ir_actions_act_multi.js
  6. 14
      web_ir_actions_act_multi/views/web_ir_actions_act_multi.xml

60
web_ir_actions_act_multi/README.rst

@ -0,0 +1,60 @@
.. image:: https://www.gnu.org/graphics/lgplv3-147x51.png
:target: https://www.gnu.org/licenses/lgpl-3.0.en.html
:alt: License: LGPL-v3
=================
Web Actions Multi
=================
This module provides a way to trigger more than one action on ActionManager
Usage
=====
To use this functionality you need to return following action with list of actions to execute:
.. code-block:: python
@api.multi
def foo():
self.ensure_one()
return {
'type': 'ir.actions.act_multi',
'actions': [
{'type': 'ir.actions.act_window_close'},
{'type': 'ir.actions.act_view_reload'},
]
}
Bug Tracker
===========
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. If you spotted it first,
help us smash it by providing detailed and welcomed feedback.
Credits
=======
Contributors
------------
* Petar Najman <petar.najman@modoolar.com>
* Mladen Meseldzija <mladen.meseldzija@modoolar.com>
Maintainer
----------
.. image:: https://odoo-community.org/logo.png
:alt: Odoo Community Association
:target: https://odoo-community.org
This module is maintained by the OCA.
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.
To contribute to this module, please visit https://odoo-community.org.

0
web_ir_actions_act_multi/__init__.py

17
web_ir_actions_act_multi/__manifest__.py

@ -0,0 +1,17 @@
# Copyright 2017 - 2018 Modoolar <info@modoolar.com>
# License LGPLv3.0 or later (https://www.gnu.org/licenses/lgpl-3.0.en.html).
{
"name": "Web Actions Multi",
"summary": "Enables triggering of more than one action on ActionManager",
"category": "Web",
"version": "11.0.1.0.0",
"license": "LGPL-3",
"author": "Modoolar, Odoo Community Association (OCA)",
"website": "https://github.com/OCA/web/",
"depends": ["web"],
"data": [
"views/web_ir_actions_act_multi.xml",
],
"installable": True,
}

BIN
web_ir_actions_act_multi/static/description/icon.png

After

Width: 128  |  Height: 128  |  Size: 9.2 KiB

31
web_ir_actions_act_multi/static/src/js/web_ir_actions_act_multi.js

@ -0,0 +1,31 @@
// Copyright 2017 - 2018 Modoolar <info@modoolar.com>
// 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) {
"use strict";
var ActionManager = require('web.ActionManager');
ActionManager.include({
execute_ir_actions_act_multi: function(actions, options, index){
var self = this;
if (index >= actions.length){
return actions[actions.length-1];
}
return self.do_action(actions[index],options)
.then(function(){
index++;
return self.execute_ir_actions_act_multi(actions, options, index);
});
},
ir_actions_act_multi: function(action, options){
return this.execute_ir_actions_act_multi(action.actions, options, 0);
},
});
});

14
web_ir_actions_act_multi/views/web_ir_actions_act_multi.xml

@ -0,0 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
# Copyright 2017 - 2018 Modoolar <info@modoolar.com>
# License LGPLv3.0 or later (https://www.gnu.org/licenses/lgpl-3.0.en.html).
-->
<odoo>
<template id="assets_backend" name="web_ir_actions_act_multi assets" 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" />
</xpath>
</template>
</odoo>
Loading…
Cancel
Save