diff --git a/web_ir_actions_act_window_none/README.rst b/web_ir_actions_act_window_none/README.rst new file mode 100644 index 00000000..8a6869af --- /dev/null +++ b/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 `_. +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 `_. + +Credits +======= + +Contributors +------------ + +* Holger Brunn + +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. diff --git a/web_ir_actions_act_window_none/__init__.py b/web_ir_actions_act_window_none/__init__.py new file mode 100644 index 00000000..fa85807b --- /dev/null +++ b/web_ir_actions_act_window_none/__init__.py @@ -0,0 +1,3 @@ +# -*- coding: utf-8 -*- +# © 2016 Therp BV +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). diff --git a/web_ir_actions_act_window_none/__openerp__.py b/web_ir_actions_act_window_none/__openerp__.py new file mode 100644 index 00000000..809f006a --- /dev/null +++ b/web_ir_actions_act_window_none/__openerp__.py @@ -0,0 +1,17 @@ +# -*- coding: utf-8 -*- +# © 2016 Therp BV +# 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', + ], +} diff --git a/web_ir_actions_act_window_none/static/description/icon.png b/web_ir_actions_act_window_none/static/description/icon.png new file mode 100644 index 00000000..3a0328b5 Binary files /dev/null and b/web_ir_actions_act_window_none/static/description/icon.png differ diff --git a/web_ir_actions_act_window_none/static/src/js/web_ir_actions_act_window_none.js b/web_ir_actions_act_window_none/static/src/js/web_ir_actions_act_window_none.js new file mode 100644 index 00000000..e933b2ee --- /dev/null +++ b/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 +//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(); + } + } + }, + }); +} diff --git a/web_ir_actions_act_window_none/views/templates.xml b/web_ir_actions_act_window_none/views/templates.xml new file mode 100644 index 00000000..adceecec --- /dev/null +++ b/web_ir_actions_act_window_none/views/templates.xml @@ -0,0 +1,10 @@ + + + + + +