Browse Source

[MIG] Migrate web_ir_actions_act_window_none from 8.0 to 11.0

pull/1297/head
George Daramouskas 5 years ago
parent
commit
db0c96185d
No known key found for this signature in database GPG Key ID: 5B4EF742F8CD859C
  1. 61
      web_ir_actions_act_window_none/README.rst
  2. 5
      web_ir_actions_act_window_none/__init__.py
  3. 7
      web_ir_actions_act_window_none/__manifest__.py
  4. 8
      web_ir_actions_act_window_none/readme/CONTRIBUTORS.rst
  5. 9
      web_ir_actions_act_window_none/readme/DESCRIPTION.rst
  6. 17
      web_ir_actions_act_window_none/readme/USAGE.rst
  7. 21
      web_ir_actions_act_window_none/static/src/js/web_ir_actions_act_window_none.js
  8. 16
      web_ir_actions_act_window_none/views/templates.xml

61
web_ir_actions_act_window_none/README.rst

@ -1,61 +0,0 @@
.. 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 <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 smashing it by providing a detailed and welcomed feedback
`here <https://github.com/OCA/web/issues/new?body=module:%20web_ir_actions_act_window_none%0Aversion:%208.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
Credits
=======
Contributors
------------
* Holger Brunn <hbrunn@therp.nl>
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.

5
web_ir_actions_act_window_none/__init__.py

@ -1,3 +1,2 @@
# -*- coding: utf-8 -*-
# © 2016 Therp BV <http://therp.nl>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
# Copyright 2019 Therp BV <https://therp.nl>
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).

7
web_ir_actions_act_window_none/__openerp__.py → web_ir_actions_act_window_none/__manifest__.py

@ -1,9 +1,8 @@
# -*- coding: utf-8 -*-
# © 2016 Therp BV <http://therp.nl>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
# Copyright 2019 Therp BV <https://therp.nl>
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
{
"name": "Noop action",
"version": "8.0.1.0.0",
"version": "11.0.1.0.0",
"author": "Therp BV,Odoo Community Association (OCA)",
"license": "AGPL-3",
"category": "Hidden/Dependency",

8
web_ir_actions_act_window_none/readme/CONTRIBUTORS.rst

@ -0,0 +1,8 @@
Credits
=======
Contributors
------------
* Holger Brunn <hbrunn@therp.nl>
* George Daramouskas <gdaramouskas@therp.nl>

9
web_ir_actions_act_window_none/readme/DESCRIPTION.rst

@ -0,0 +1,9 @@
===========
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.

17
web_ir_actions_act_window_none/readme/USAGE.rst

@ -0,0 +1,17 @@
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

21
web_ir_actions_act_window_none/static/src/js/web_ir_actions_act_window_none.js

@ -1,19 +1,16 @@
//-*- coding: utf-8 -*-
//© 2016 Therp BV <http://therp.nl>
//Copyright 2019 Therp BV <http://therp.nl>
//License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
odoo.define('web_ir_actions_act_window_none.act_window_none',
function (required) {
var ActionManager = require('web.ActionManager');
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)
{
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();
}
}
},
}
});
}

16
web_ir_actions_act_window_none/views/templates.xml

@ -1,10 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<openerp>
<data>
<template id="assets_backend" name="web_ir_actions_act_window_none assets" inherit_id="web.assets_backend">
<xpath expr="." position="inside">
<script type="text/javascript" src="/web_ir_actions_act_window_none/static/src/js/web_ir_actions_act_window_none.js"></script>
</xpath>
</template>
</data>
</openerp>
<odoo>
<template id="assets_backend" name="web_ir_actions_act_window_none assets" inherit_id="web.assets_backend">
<xpath expr="." position="inside">
<script type="text/javascript" src="/web_ir_actions_act_window_none/static/src/js/web_ir_actions_act_window_none.js"></script>
</xpath>
</template>
</odoo>
Loading…
Cancel
Save