mirror of
https://github.com/OCA/web.git
synced 2025-02-22 13:21:25 +02:00
[MIG] web_ir_actions_act_window_message: Migration to 10. Also added HTML handling
This commit is contained in:
committed by
Jasmin Solanki
parent
4ed7715658
commit
c8a72e5fcc
@@ -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() })
|
||||
|
||||
Reference in New Issue
Block a user