forked from Techsystech/web
implement close_button_title
parent
0b078c7899
commit
346adda20b
|
@ -14,6 +14,11 @@ Depend on this module and return
|
||||||
'type': 'ir.actions.act_window.message',
|
'type': 'ir.actions.act_window.message',
|
||||||
'title': _('My title'),
|
'title': _('My title'),
|
||||||
'message': _('My message'),
|
'message': _('My message'),
|
||||||
|
# optional title of the close button, if not set, will be _('Close')
|
||||||
|
# if set False, no close button will be shown
|
||||||
|
# you can create your own close button with an action of type
|
||||||
|
# ir.actions.act_window_close
|
||||||
|
'close_button_title': 'Make this window go away',
|
||||||
# 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)
|
||||||
|
@ -47,7 +52,6 @@ Known issues / Roadmap
|
||||||
|
|
||||||
* add `message_type` to differenciate between warnings, errors, etc.
|
* add `message_type` to differenciate between warnings, errors, etc.
|
||||||
* have one `message_type` to show a nonmodal warning on top right
|
* have one `message_type` to show a nonmodal warning on top right
|
||||||
* have `button_title` to set the button title
|
|
||||||
|
|
||||||
|
|
||||||
Bug Tracker
|
Bug Tracker
|
||||||
|
|
|
@ -25,18 +25,24 @@ openerp.web_ir_actions_act_window_message = function(instance)
|
||||||
ir_actions_act_window_message: function(action, options)
|
ir_actions_act_window_message: function(action, options)
|
||||||
{
|
{
|
||||||
var self = this,
|
var self = this,
|
||||||
dialog = new instance.web.Dialog(
|
buttons = [];
|
||||||
|
|
||||||
|
if(action.close_button_title !== false)
|
||||||
|
{
|
||||||
|
buttons.push({
|
||||||
|
text: action.close_button_title ||
|
||||||
|
instance.web._t('Close'),
|
||||||
|
click: function() { dialog.close() },
|
||||||
|
oe_link_class: 'oe_highlight',
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
var dialog = new instance.web.Dialog(
|
||||||
this,
|
this,
|
||||||
{
|
{
|
||||||
size: 'medium',
|
size: 'medium',
|
||||||
title: action.title,
|
title: action.title,
|
||||||
buttons: [
|
buttons: buttons.concat(
|
||||||
{
|
|
||||||
text: instance.web._t('Close'),
|
|
||||||
click: function() { dialog.close() },
|
|
||||||
oe_link_class: 'oe_highlight',
|
|
||||||
},
|
|
||||||
].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…
Reference in New Issue