diff --git a/setup/web_ir_actions_close_wizard_refresh_view/odoo/addons/web_ir_actions_close_wizard_refresh_view b/setup/web_ir_actions_close_wizard_refresh_view/odoo/addons/web_ir_actions_close_wizard_refresh_view new file mode 120000 index 000000000..fceb7bc86 --- /dev/null +++ b/setup/web_ir_actions_close_wizard_refresh_view/odoo/addons/web_ir_actions_close_wizard_refresh_view @@ -0,0 +1 @@ +../../../../web_ir_actions_close_wizard_refresh_view \ No newline at end of file diff --git a/setup/web_ir_actions_close_wizard_refresh_view/setup.py b/setup/web_ir_actions_close_wizard_refresh_view/setup.py new file mode 100644 index 000000000..28c57bb64 --- /dev/null +++ b/setup/web_ir_actions_close_wizard_refresh_view/setup.py @@ -0,0 +1,6 @@ +import setuptools + +setuptools.setup( + setup_requires=['setuptools-odoo'], + odoo_addon=True, +) diff --git a/web_ir_actions_close_wizard_refresh_view/README.rst b/web_ir_actions_close_wizard_refresh_view/README.rst new file mode 100644 index 000000000..6b6cd0c0e --- /dev/null +++ b/web_ir_actions_close_wizard_refresh_view/README.rst @@ -0,0 +1,91 @@ +========================= +Close Wizard Refresh View +========================= + +.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png + :target: https://odoo-community.org/page/development-status + :alt: Beta +.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png + :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html + :alt: License: AGPL-3 +.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fweb-lightgray.png?logo=github + :target: https://github.com/OCA/web/tree/12.0/web_ir_actions_close_wizard_refresh_view + :alt: OCA/web +.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png + :target: https://translation.odoo-community.org/projects/web-12-0/web-12-0-web_ir_actions_close_wizard_refresh_view + :alt: Translate me on Weblate +.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png + :target: https://runbot.odoo-community.org/runbot/162/12.0 + :alt: Try me on Runbot + +|badge1| |badge2| |badge3| |badge4| |badge5| + +Let reload the data in a view, while closing a wizard, without reloading the page. + +**Table of contents** + +.. contents:: + :local: + +Usage +===== + +Return an action literal with the following type: 'ir.actions.close_wizard_refresh_view'. + +For example: + +:: + + def method_called_by_wizard(self): + + .. + .. + + return { + 'type': 'ir.actions.close_wizard_refresh_view' + } + +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 `_. + +Do not contact contributors directly about support or help with technical issues. + +Credits +======= + +Authors +~~~~~~~ + +* LevelPrime srl +* Nova Code BV + +Contributors +~~~~~~~~~~~~ +* Bob Leers + +Maintainers +~~~~~~~~~~~ + +This module is maintained by the OCA. + +.. image:: https://odoo-community.org/logo.png + :alt: Odoo Community Association + :target: https://odoo-community.org + +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. + +This module is part of the `OCA/web `_ project on GitHub. + +You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/web_ir_actions_close_wizard_refresh_view/__init__.py b/web_ir_actions_close_wizard_refresh_view/__init__.py new file mode 100644 index 000000000..04a12d304 --- /dev/null +++ b/web_ir_actions_close_wizard_refresh_view/__init__.py @@ -0,0 +1,4 @@ +# Copyright 2019 LevelPrime +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl) + +from . import models diff --git a/web_ir_actions_close_wizard_refresh_view/__manifest__.py b/web_ir_actions_close_wizard_refresh_view/__manifest__.py new file mode 100644 index 000000000..777104030 --- /dev/null +++ b/web_ir_actions_close_wizard_refresh_view/__manifest__.py @@ -0,0 +1,23 @@ +# Copyright 2019 LevelPrime +# Copyright 2023 Nova Code (https://www.novacode.nl) +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl) + +{ + "name": "Close Wizard Refresh View", + "summary": """Allow to refresh view data without reload the page.""", + "version": "16.0.1.0.0", + "development_status": "Beta", + "author": "LevelPrime srl, Nova Code, Odoo Community Association (OCA)", + "website": "https://github.com/OCA/web", + "license": "AGPL-3", + "category": "Web", + "depends": ["web"], + "data": ["security/ir.model.access.csv"], + "assets": { + "web.assets_backend": [ + "web_ir_actions_close_wizard_refresh_view/static/src/js/*.js" + ] + }, + "application": False, + "installable": True, +} diff --git a/web_ir_actions_close_wizard_refresh_view/models/__init__.py b/web_ir_actions_close_wizard_refresh_view/models/__init__.py new file mode 100644 index 000000000..16285e5e1 --- /dev/null +++ b/web_ir_actions_close_wizard_refresh_view/models/__init__.py @@ -0,0 +1 @@ +from . import ir_actions diff --git a/web_ir_actions_close_wizard_refresh_view/models/ir_actions.py b/web_ir_actions_close_wizard_refresh_view/models/ir_actions.py new file mode 100644 index 000000000..37137fa92 --- /dev/null +++ b/web_ir_actions_close_wizard_refresh_view/models/ir_actions.py @@ -0,0 +1,10 @@ +from odoo import fields, models + + +class IrActionsCloseWizardRefreshView(models.Model): + _name = "ir.actions.close_wizard_refresh_view" + _description = "Action Close Wizard Window Refresh View" + _inherit = "ir.actions.act_window_close" + _table = "ir_actions" + + type = fields.Char(default="ir.actions.close_wizard_refresh_view") diff --git a/web_ir_actions_close_wizard_refresh_view/readme/DESCRIPTION.rst b/web_ir_actions_close_wizard_refresh_view/readme/DESCRIPTION.rst new file mode 100644 index 000000000..b5b661340 --- /dev/null +++ b/web_ir_actions_close_wizard_refresh_view/readme/DESCRIPTION.rst @@ -0,0 +1 @@ +Let reload the data in a view, while closing a wizard, without reloading the page. diff --git a/web_ir_actions_close_wizard_refresh_view/readme/USAGE.rst b/web_ir_actions_close_wizard_refresh_view/readme/USAGE.rst new file mode 100644 index 000000000..535823c5e --- /dev/null +++ b/web_ir_actions_close_wizard_refresh_view/readme/USAGE.rst @@ -0,0 +1,14 @@ +Return an action literal with the following type: 'ir.actions.close_wizard_refresh_view'. + +For example: + +:: + + def method_called_by_wizard(self): + + .. + .. + + return { + 'type': 'ir.actions.close_wizard_refresh_view' + } diff --git a/web_ir_actions_close_wizard_refresh_view/security/ir.model.access.csv b/web_ir_actions_close_wizard_refresh_view/security/ir.model.access.csv new file mode 100644 index 000000000..4ea50855a --- /dev/null +++ b/web_ir_actions_close_wizard_refresh_view/security/ir.model.access.csv @@ -0,0 +1,2 @@ +id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink +access_ir_actions_close_wizard_refresh_view,access_ir_actions_close_wizard_refresh_view,model_ir_actions_close_wizard_refresh_view,base.group_user,1,1,1,1 diff --git a/web_ir_actions_close_wizard_refresh_view/static/description/icon.png b/web_ir_actions_close_wizard_refresh_view/static/description/icon.png new file mode 100644 index 000000000..3a0328b51 Binary files /dev/null and b/web_ir_actions_close_wizard_refresh_view/static/description/icon.png differ diff --git a/web_ir_actions_close_wizard_refresh_view/static/description/index.html b/web_ir_actions_close_wizard_refresh_view/static/description/index.html new file mode 100644 index 000000000..c06eafc09 --- /dev/null +++ b/web_ir_actions_close_wizard_refresh_view/static/description/index.html @@ -0,0 +1,429 @@ + + + + + + +Close Wizard Refresh View + + + +
+

Close Wizard Refresh View

+ + +

Beta License: AGPL-3 OCA/web Translate me on Weblate Try me on Runbot

+

Let reload the data in a view, while closing a wizard, without reloading the page.

+

Table of contents

+ +
+

Usage

+

Return an action literal with the following type: ‘ir.actions.close_wizard_refresh_view’.

+

For example:

+
+def method_called_by_wizard(self):
+
+  ..
+  ..
+
+  return {
+      'type': 'ir.actions.close_wizard_refresh_view'
+  }
+
+
+
+

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.

+

Do not contact contributors directly about support or help with technical issues.

+
+
+

Credits

+
+

Authors

+
    +
  • LevelPrime srl
  • +
  • Nova Code BV
  • +
+
+
+

Maintainers

+

This module is maintained by the OCA.

+Odoo Community Association +

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.

+

This module is part of the OCA/web project on GitHub.

+

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

+
+
+
+ + diff --git a/web_ir_actions_close_wizard_refresh_view/static/src/js/web_ir_actions_close_wizard_refresh_view.esm.js b/web_ir_actions_close_wizard_refresh_view/static/src/js/web_ir_actions_close_wizard_refresh_view.esm.js new file mode 100644 index 000000000..55e4f865e --- /dev/null +++ b/web_ir_actions_close_wizard_refresh_view/static/src/js/web_ir_actions_close_wizard_refresh_view.esm.js @@ -0,0 +1,20 @@ +/** @odoo-module **/ + +import {registry} from "@web/core/registry"; + +async function executeCloseAndRefreshView({env, action}) { + const actionService = env.services.action; + const originalAction = action._originalAction; + return actionService.doAction( + {type: "ir.actions.act_window_close"}, + { + onClose: function () { + actionService.doAction(originalAction); + }, + } + ); +} + +registry + .category("action_handlers") + .add("ir.actions.close_wizard_refresh_view", executeCloseAndRefreshView);