From 6d1ee3311d37d96a87f86d2d52940e9f80c62cc3 Mon Sep 17 00:00:00 2001 From: Michele Zaccheddu Date: Thu, 28 Nov 2019 15:56:55 +0100 Subject: [PATCH] [12.0][ADD][web_ir_actions_close_wizard_refresh_view] Add module --- .../README.rst | 86 ++++ .../__init__.py | 2 + .../__manifest__.py | 21 + .../readme/DESCRIPTION.rst | 1 + .../readme/USAGE.rst | 14 + .../static/description/index.html | 428 ++++++++++++++++++ ...eb_ir_actions_close_wizard_refresh_view.js | 23 + .../templates/assets.xml | 13 + 8 files changed, 588 insertions(+) create mode 100644 web_ir_actions_close_wizard_refresh_view/README.rst create mode 100644 web_ir_actions_close_wizard_refresh_view/__init__.py create mode 100644 web_ir_actions_close_wizard_refresh_view/__manifest__.py create mode 100644 web_ir_actions_close_wizard_refresh_view/readme/DESCRIPTION.rst create mode 100644 web_ir_actions_close_wizard_refresh_view/readme/USAGE.rst create mode 100644 web_ir_actions_close_wizard_refresh_view/static/description/index.html create mode 100644 web_ir_actions_close_wizard_refresh_view/static/src/js/web_ir_actions_close_wizard_refresh_view.js create mode 100644 web_ir_actions_close_wizard_refresh_view/templates/assets.xml 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..a0ab71482 --- /dev/null +++ b/web_ir_actions_close_wizard_refresh_view/README.rst @@ -0,0 +1,86 @@ +========================= +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 + +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..3a4eb0cbf --- /dev/null +++ b/web_ir_actions_close_wizard_refresh_view/__init__.py @@ -0,0 +1,2 @@ +# Copyright 2019 LevelPrime +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl) 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..10a1bda7e --- /dev/null +++ b/web_ir_actions_close_wizard_refresh_view/__manifest__.py @@ -0,0 +1,21 @@ +# Copyright 2019 LevelPrime +# 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': '12.0.1.0.0', + 'development_status': 'Beta', + 'author': "LevelPrime srl, " + "Odoo Community Association (OCA)", + 'website': "https://github.com/OCA/web/tree/12.0/" + "web_ir_actions_close_wizard_refresh_view", + 'license': 'AGPL-3', + 'category': 'Web', + 'depends': ['web'], + 'data': [ + 'templates/assets.xml' + ], + 'application': False, + 'installable': True +} 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/static/description/index.html b/web_ir_actions_close_wizard_refresh_view/static/description/index.html new file mode 100644 index 000000000..4b2159fbd --- /dev/null +++ b/web_ir_actions_close_wizard_refresh_view/static/description/index.html @@ -0,0 +1,428 @@ + + + + + + +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
  • +
+
+
+

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.js b/web_ir_actions_close_wizard_refresh_view/static/src/js/web_ir_actions_close_wizard_refresh_view.js new file mode 100644 index 000000000..49c93aacc --- /dev/null +++ b/web_ir_actions_close_wizard_refresh_view/static/src/js/web_ir_actions_close_wizard_refresh_view.js @@ -0,0 +1,23 @@ +/* Copyright 2019 LevelPrime + * License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). */ + +odoo.define('web_ir_actions_close_wizard_refresh_view', function (require) { + 'use strict'; + + require('web.ActionManager').include({ + _handleAction: function (action, options) { + if (action.type === 'ir.actions.close_wizard_refresh_view') { + return this._executeCloseWizardRefreshViewAction(); + } + return this._super(action, options); + }, + _executeCloseWizardRefreshViewAction: function () { + this._closeDialog(); + + var state = this._getControllerState( + this.getCurrentController().jsID); + + return $.when(this.loadState(state)); + }, + }); +}); diff --git a/web_ir_actions_close_wizard_refresh_view/templates/assets.xml b/web_ir_actions_close_wizard_refresh_view/templates/assets.xml new file mode 100644 index 000000000..2008522ce --- /dev/null +++ b/web_ir_actions_close_wizard_refresh_view/templates/assets.xml @@ -0,0 +1,13 @@ + + + + +