Browse Source

Contribution: add module web_ir_actions_act_view_reload

pull/1104/head
Petar Najman 6 years ago
committed by Alexey Pelykh
parent
commit
06b19d7b24
  1. 55
      web_ir_actions_act_view_reload/README.rst
  2. 0
      web_ir_actions_act_view_reload/__init__.py
  3. 17
      web_ir_actions_act_view_reload/__manifest__.py
  4. BIN
      web_ir_actions_act_view_reload/static/description/icon.png
  5. 16
      web_ir_actions_act_view_reload/static/src/js/web_ir_actions_act_view_reload.js
  6. 14
      web_ir_actions_act_view_reload/views/web_ir_actions_act_view_reload.xml

55
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
<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 smash it by providing detailed and welcomed feedback.
Credits
=======
Contributors
------------
* Petar Najman <petar.najman@modoolar.com>
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.

0
web_ir_actions_act_view_reload/__init__.py

17
web_ir_actions_act_view_reload/__manifest__.py

@ -0,0 +1,17 @@
# Copyright 2017 - 2018 Modoolar <info@modoolar.com>
# 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,
}

BIN
web_ir_actions_act_view_reload/static/description/icon.png

After

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

16
web_ir_actions_act_view_reload/static/src/js/web_ir_actions_act_view_reload.js

@ -0,0 +1,16 @@
// Copyright 2017 - 2018 Modoolar <info@modoolar.com>
// 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();
}
});
});

14
web_ir_actions_act_view_reload/views/web_ir_actions_act_view_reload.xml

@ -0,0 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
# Copyright 2017 - 2018 Modoolar <info@modoolar.com>
# License LGPLv3.0 or later (https://www.gnu.org/licenses/lgpl-3.0.en.html).
-->
<odoo>
<template id="assets_backend" name="web_ir_actions_act_view_reload assets" inherit_id="web.assets_backend">
<xpath expr="." position="inside">
<script type="text/javascript"
src="/web_ir_actions_act_view_reload/static/src/js/web_ir_actions_act_view_reload.js"/>
</xpath>
</template>
</odoo>
Loading…
Cancel
Save