diff --git a/web_ir_actions_act_view_reload/README.rst b/web_ir_actions_act_view_reload/README.rst new file mode 100644 index 00000000..01bed1e8 --- /dev/null +++ b/web_ir_actions_act_view_reload/README.rst @@ -0,0 +1,55 @@ +.. 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 Window Reload +========================= + +This module provides a way to trigger reload of the current window on ActionManager + +Usage +===== + +To use this functionality you need to return following action: + +.. code-block:: python + + @api.multi + def foo(): + self.ensure_one() + return { + 'type': 'ir.actions.act_view_reload', + } + +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 smash it by providing detailed and welcomed feedback. + +Credits +======= + + +Contributors +------------ + +* Petar Najman + +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_view_reload/__init__.py b/web_ir_actions_act_view_reload/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/web_ir_actions_act_view_reload/__manifest__.py b/web_ir_actions_act_view_reload/__manifest__.py new file mode 100644 index 00000000..263b2768 --- /dev/null +++ b/web_ir_actions_act_view_reload/__manifest__.py @@ -0,0 +1,17 @@ +# Copyright 2017 - 2018 Modoolar +# License LGPLv3.0 or later (https://www.gnu.org/licenses/lgpl-3.0.en.html). + +{ + "name": "Web Actions View Reload", + "summary": "Enables reload of the current view via 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_view_reload.xml", + ], + "installable": True, +} diff --git a/web_ir_actions_act_view_reload/static/description/icon.png b/web_ir_actions_act_view_reload/static/description/icon.png new file mode 100644 index 00000000..3a0328b5 Binary files /dev/null and b/web_ir_actions_act_view_reload/static/description/icon.png differ diff --git a/web_ir_actions_act_view_reload/static/src/js/web_ir_actions_act_view_reload.js b/web_ir_actions_act_view_reload/static/src/js/web_ir_actions_act_view_reload.js new file mode 100644 index 00000000..9d85a531 --- /dev/null +++ b/web_ir_actions_act_view_reload/static/src/js/web_ir_actions_act_view_reload.js @@ -0,0 +1,16 @@ +// Copyright 2017 - 2018 Modoolar +// License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). +odoo.define('web_ir_actions_act_view_reload.ir_actions_act_view_reload', function (require) { +"use strict"; + + var ActionManager = require('web.ActionManager'); + + ActionManager.include({ + ir_actions_act_view_reload: function (action, options) { + if (this.inner_widget && this.inner_widget.active_view && this.inner_widget.active_view.controller) + this.inner_widget.active_view.controller.reload(); + return $.when(); + } + }); + +}); diff --git a/web_ir_actions_act_view_reload/views/web_ir_actions_act_view_reload.xml b/web_ir_actions_act_view_reload/views/web_ir_actions_act_view_reload.xml new file mode 100644 index 00000000..2a1c0364 --- /dev/null +++ b/web_ir_actions_act_view_reload/views/web_ir_actions_act_view_reload.xml @@ -0,0 +1,14 @@ + + + +