Browse Source

[MIG] web_ir_actions_act_window_message: Migration to 10. Also added HTML handling

pull/644/head
Benjamin Willig 8 years ago
committed by Jairo Llopis
parent
commit
4e3b640b05
  1. 1
      setup/web_ir_actions_act_window_message/odoo/__init__.py
  2. 1
      setup/web_ir_actions_act_window_message/odoo/addons/__init__.py
  3. 1
      setup/web_ir_actions_act_window_message/odoo/addons/web_ir_actions_act_window_message
  4. 6
      setup/web_ir_actions_act_window_message/setup.py
  5. 3
      web_ir_actions_act_window_message/README.rst
  6. 2
      web_ir_actions_act_window_message/__manifest__.py
  7. 26
      web_ir_actions_act_window_message/static/src/js/web_ir_actions_act_window_message.js

1
setup/web_ir_actions_act_window_message/odoo/__init__.py

@ -0,0 +1 @@
__import__('pkg_resources').declare_namespace(__name__)

1
setup/web_ir_actions_act_window_message/odoo/addons/__init__.py

@ -0,0 +1 @@
__import__('pkg_resources').declare_namespace(__name__)

1
setup/web_ir_actions_act_window_message/odoo/addons/web_ir_actions_act_window_message

@ -0,0 +1 @@
../../../../web_ir_actions_act_window_message

6
setup/web_ir_actions_act_window_message/setup.py

@ -0,0 +1,6 @@
import setuptools
setuptools.setup(
setup_requires=['setuptools-odoo'],
odoo_addon=True,
)

3
web_ir_actions_act_window_message/README.rst

@ -19,6 +19,8 @@ Depend on this module and return
# you can create your own close button with an action of type # you can create your own close button with an action of type
# ir.actions.act_window_close # ir.actions.act_window_close
'close_button_title': 'Make this window go away', 'close_button_title': 'Make this window go away',
# Use HTML instead of text
'is_html_message': True,
# this is an optional list of buttons to show # this is an optional list of buttons to show
'buttons': [ 'buttons': [
# a button can be any action (also ir.actions.report.xml et al) # a button can be any action (also ir.actions.report.xml et al)
@ -73,6 +75,7 @@ Contributors
* Holger Brunn <hbrunn@therp.nl> * Holger Brunn <hbrunn@therp.nl>
* Zakaria Makrelouf (ACSONE SA/NV) <z.makrelouf@gmail.com> * Zakaria Makrelouf (ACSONE SA/NV) <z.makrelouf@gmail.com>
* Benjamin Willig (ACSONE SA/NV) <benjamin.willig@acsone.eu>
Maintainer Maintainer
---------- ----------

2
web_ir_actions_act_window_message/__manifest__.py

@ -3,7 +3,7 @@
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
{ {
"name": "Client side message boxes", "name": "Client side message boxes",
"version": "9.0.1.0.0",
"version": "10.0.1.0.0",
"author": "Therp BV, " "author": "Therp BV, "
"ACSONE SA/NV, " "ACSONE SA/NV, "
"Odoo Community Association (OCA)", "Odoo Community Association (OCA)",

26
web_ir_actions_act_window_message/static/src/js/web_ir_actions_act_window_message.js

@ -7,7 +7,6 @@ odoo.define('web.web_ir_actions_act_window_message', function(require)
var ActionManager = require('web.ActionManager'), var ActionManager = require('web.ActionManager'),
core = require('web.core'), core = require('web.core'),
_ = require('_'),
Model = require('web.Model'), Model = require('web.Model'),
Dialog = require('web.Dialog'); Dialog = require('web.Dialog');
@ -33,20 +32,29 @@ odoo.define('web.web_ir_actions_act_window_message', function(require)
}) })
} }
var is_html = action.is_html_message === true;
var content_properties = {};
if (is_html) {
content_properties = {
html: action.message,
};
} else {
content_properties = {
text: action.message,
css: {
'white-space': 'pre-line',
}
};
}
var dialog = new Dialog( var dialog = new Dialog(
this, this,
_.extend( _.extend(
{ {
size: 'medium', size: 'medium',
title: action.title, title: action.title,
$content: $('<div>',
{
text: action.message,
css: {
'white-space': 'pre-line',
}
}
),
$content: $('<div>', content_properties),
buttons: buttons.concat( buttons: buttons.concat(
this.ir_actions_act_window_message_get_buttons( this.ir_actions_act_window_message_get_buttons(
action, function() { dialog.close() }) action, function() { dialog.close() })

Loading…
Cancel
Save