forked from Techsystech/web
[ADD] web_ir_actions_act_window_message
parent
8c4023304a
commit
d472033565
|
@ -0,0 +1,50 @@
|
||||||
|
Client side message boxes
|
||||||
|
=========================
|
||||||
|
|
||||||
|
This module allows to show a message popup on the client side as result of a button.
|
||||||
|
|
||||||
|
Usage
|
||||||
|
=====
|
||||||
|
|
||||||
|
Depend on this module and return
|
||||||
|
|
||||||
|
.. code:: python
|
||||||
|
|
||||||
|
{
|
||||||
|
'type': 'ir.actions.act_window.message',
|
||||||
|
'title': 'My title',
|
||||||
|
'message': 'My message'
|
||||||
|
}
|
||||||
|
|
||||||
|
You are responsible for translating the messages.
|
||||||
|
|
||||||
|
* https://www.odoo.com/forum/help-1
|
||||||
|
|
||||||
|
Known issues / Roadmap
|
||||||
|
======================
|
||||||
|
|
||||||
|
* add `message_type` to differenciate between warnings, errors, etc.
|
||||||
|
* have one `message_type` to show a nonmodal warning on top right
|
||||||
|
* have `button_title` to set the button title
|
||||||
|
* have `buttons` containing button names and action definitions for triggering actions from the message box
|
||||||
|
|
||||||
|
Credits
|
||||||
|
=======
|
||||||
|
|
||||||
|
Contributors
|
||||||
|
------------
|
||||||
|
|
||||||
|
* Holger Brunn <hbrunn@therp.nl>
|
||||||
|
|
||||||
|
Maintainer
|
||||||
|
----------
|
||||||
|
|
||||||
|
.. image:: http://odoo-community.org/logo.png
|
||||||
|
:alt: Odoo Community Association
|
||||||
|
:target: http://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 http://odoo-community.org.
|
|
@ -0,0 +1,20 @@
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
##############################################################################
|
||||||
|
#
|
||||||
|
# OpenERP, Open Source Management Solution
|
||||||
|
# This module copyright (C) 2015 Therp BV <http://therp.nl>.
|
||||||
|
#
|
||||||
|
# This program is free software: you can redistribute it and/or modify
|
||||||
|
# it under the terms of the GNU Affero General Public License as
|
||||||
|
# published by the Free Software Foundation, either version 3 of the
|
||||||
|
# License, or (at your option) any later version.
|
||||||
|
#
|
||||||
|
# This program is distributed in the hope that it will be useful,
|
||||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
# GNU Affero General Public License for more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU Affero General Public License
|
||||||
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
#
|
||||||
|
##############################################################################
|
|
@ -0,0 +1,43 @@
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
##############################################################################
|
||||||
|
#
|
||||||
|
# OpenERP, Open Source Management Solution
|
||||||
|
# This module copyright (C) 2015 Therp BV <http://therp.nl>.
|
||||||
|
#
|
||||||
|
# This program is free software: you can redistribute it and/or modify
|
||||||
|
# it under the terms of the GNU Affero General Public License as
|
||||||
|
# published by the Free Software Foundation, either version 3 of the
|
||||||
|
# License, or (at your option) any later version.
|
||||||
|
#
|
||||||
|
# This program is distributed in the hope that it will be useful,
|
||||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
# GNU Affero General Public License for more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU Affero General Public License
|
||||||
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
#
|
||||||
|
##############################################################################
|
||||||
|
{
|
||||||
|
"name": "Client side message boxes",
|
||||||
|
"version": "1.0",
|
||||||
|
"author": "Therp BV",
|
||||||
|
"license": "AGPL-3",
|
||||||
|
"category": "Hidden/Dependency",
|
||||||
|
"summary": "Show a warning to users",
|
||||||
|
"depends": [
|
||||||
|
'web',
|
||||||
|
],
|
||||||
|
"data": [
|
||||||
|
'views/templates.xml',
|
||||||
|
],
|
||||||
|
"qweb": [
|
||||||
|
'static/src/xml/web_ir_actions_act_window_message.xml',
|
||||||
|
],
|
||||||
|
"auto_install": False,
|
||||||
|
"installable": True,
|
||||||
|
"application": False,
|
||||||
|
"external_dependencies": {
|
||||||
|
'python': [],
|
||||||
|
},
|
||||||
|
}
|
Binary file not shown.
After Width: | Height: | Size: 2.0 KiB |
|
@ -0,0 +1,50 @@
|
||||||
|
//-*- coding: utf-8 -*-
|
||||||
|
//############################################################################
|
||||||
|
//
|
||||||
|
// OpenERP, Open Source Management Solution
|
||||||
|
// This module copyright (C) 2015 Therp BV <http://therp.nl>.
|
||||||
|
//
|
||||||
|
// This program is free software: you can redistribute it and/or modify
|
||||||
|
// it under the terms of the GNU Affero General Public License as
|
||||||
|
// published by the Free Software Foundation, either version 3 of the
|
||||||
|
// License, or (at your option) any later version.
|
||||||
|
//
|
||||||
|
// This program is distributed in the hope that it will be useful,
|
||||||
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
// GNU Affero General Public License for more details.
|
||||||
|
//
|
||||||
|
// You should have received a copy of the GNU Affero General Public License
|
||||||
|
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
//
|
||||||
|
//############################################################################
|
||||||
|
|
||||||
|
openerp.web_ir_actions_act_window_message = function(instance)
|
||||||
|
{
|
||||||
|
instance.web.ActionManager.include({
|
||||||
|
ir_actions_act_window_message: function(action, options)
|
||||||
|
{
|
||||||
|
var dialog = new instance.web.Dialog(
|
||||||
|
this,
|
||||||
|
{
|
||||||
|
size: 'medium',
|
||||||
|
title: action.title,
|
||||||
|
buttons: [
|
||||||
|
{
|
||||||
|
text: instance.web._t('Close'),
|
||||||
|
click: function() { dialog.close() },
|
||||||
|
oe_link_class: 'oe_highlight',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
jQuery(instance.web.qweb.render(
|
||||||
|
'web_ir_actions_act_window_message',
|
||||||
|
{
|
||||||
|
'this': this,
|
||||||
|
'action': action,
|
||||||
|
}))
|
||||||
|
)
|
||||||
|
return dialog.open();
|
||||||
|
},
|
||||||
|
});
|
||||||
|
}
|
|
@ -0,0 +1,5 @@
|
||||||
|
<templates>
|
||||||
|
<div t-name="web_ir_actions_act_window_message">
|
||||||
|
<div><t t-esc="action.message" /></div>
|
||||||
|
</div>
|
||||||
|
</templates>
|
|
@ -0,0 +1,10 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<openerp>
|
||||||
|
<data>
|
||||||
|
<template id="assets_backend" name="web_ir_actions_act_window_message assets" inherit_id="web.assets_backend">
|
||||||
|
<xpath expr="." position="inside">
|
||||||
|
<script type="text/javascript" src="/web_ir_actions_act_window_message/static/src/js/web_ir_actions_act_window_message.js"></script>
|
||||||
|
</xpath>
|
||||||
|
</template>
|
||||||
|
</data>
|
||||||
|
</openerp>
|
Loading…
Reference in New Issue