Browse Source

Merge pull request #348 from hbrunn/8.0-web_ir_actions_act_window_none

[ADD] web_ir_actions_act_window_none
pull/488/head
Pedro M. Baeza 8 years ago
committed by GitHub
parent
commit
d88d7cebaa
  1. 61
      web_ir_actions_act_window_none/README.rst
  2. 3
      web_ir_actions_act_window_none/__init__.py
  3. 17
      web_ir_actions_act_window_none/__openerp__.py
  4. BIN
      web_ir_actions_act_window_none/static/description/icon.png
  5. 19
      web_ir_actions_act_window_none/static/src/js/web_ir_actions_act_window_none.js
  6. 10
      web_ir_actions_act_window_none/views/templates.xml

61
web_ir_actions_act_window_none/README.rst

@ -0,0 +1,61 @@
.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg
:alt: License: AGPL-3
===========
Noop action
===========
This module was written to have an action that does nothing. A notorious case
where this is useful is buttons on popup windows, because they need to return
an action. Given the default here is `ir.actions.act_window_close`, you'll
have to jump through some hoops if you have a button that is not supposed to
close the popup window.
Usage
=====
To use this module, depend on it in your module and return::
{'type': 'ir.actions.act_window.none'}
The button will trigger a reload of the popup's form, in case you want to
suppress this, set key ``reload`` to ``False`` in the action you return.
.. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas
:alt: Try me on Runbot
:target: https://runbot.odoo-community.org/runbot/162/8.0
For further information, please visit:
* https://www.odoo.com/forum/help-1
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 smashing it by providing a detailed and welcomed feedback
`here <https://github.com/OCA/web/issues/new?body=module:%20web_ir_actions_act_window_none%0Aversion:%208.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
Credits
=======
Contributors
------------
* Holger Brunn <hbrunn@therp.nl>
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.

3
web_ir_actions_act_window_none/__init__.py

@ -0,0 +1,3 @@
# -*- coding: utf-8 -*-
# © 2016 Therp BV <http://therp.nl>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).

17
web_ir_actions_act_window_none/__openerp__.py

@ -0,0 +1,17 @@
# -*- coding: utf-8 -*-
# © 2016 Therp BV <http://therp.nl>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
{
"name": "Noop action",
"version": "8.0.1.0.0",
"author": "Therp BV,Odoo Community Association (OCA)",
"license": "AGPL-3",
"category": "Hidden/Dependency",
"summary": "Execute nothing",
"depends": [
'web',
],
"data": [
'views/templates.xml',
],
}

BIN
web_ir_actions_act_window_none/static/description/icon.png

After

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

19
web_ir_actions_act_window_none/static/src/js/web_ir_actions_act_window_none.js

@ -0,0 +1,19 @@
//-*- coding: utf-8 -*-
//© 2016 Therp BV <http://therp.nl>
//License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
openerp.web_ir_actions_act_window_none = function(instance)
{
instance.web.ActionManager.include({
ir_actions_act_window_none: function(action)
{
if(action.reload === undefined || action.reload)
{
if(this.dialog_widget && this.dialog_widget.views.form)
{
return this.dialog_widget.views.form.controller.reload();
}
}
},
});
}

10
web_ir_actions_act_window_none/views/templates.xml

@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<openerp>
<data>
<template id="assets_backend" name="web_ir_actions_act_window_none assets" inherit_id="web.assets_backend">
<xpath expr="." position="inside">
<script type="text/javascript" src="/web_ir_actions_act_window_none/static/src/js/web_ir_actions_act_window_none.js"></script>
</xpath>
</template>
</data>
</openerp>
Loading…
Cancel
Save