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

This commit is contained in:
Benjamin Willig
2017-05-23 17:25:01 +02:00
committed by Jasmin Solanki
parent 4ed7715658
commit c8a72e5fcc
3 changed files with 22 additions and 11 deletions

View File

@@ -7,7 +7,6 @@ odoo.define('web.web_ir_actions_act_window_message', function(require)
var ActionManager = require('web.ActionManager'),
core = require('web.core'),
_ = require('_'),
Model = require('web.Model'),
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(
this,
_.extend(
{
size: 'medium',
title: action.title,
$content: $('<div>',
{
text: action.message,
css: {
'white-space': 'pre-line',
}
}
),
$content: $('<div>', content_properties),
buttons: buttons.concat(
this.ir_actions_act_window_message_get_buttons(
action, function() { dialog.close() })