mirror of
https://github.com/OCA/web.git
synced 2025-02-22 13:21:25 +02:00
Add possibility to return an action in a notification
This commit is contained in:
committed by
Yannick Vaucher
parent
8d3f2749e4
commit
b333cdc7b1
@@ -12,10 +12,14 @@ odoo.define('web_notify.notification', function (require) {
|
||||
events: _.extend(
|
||||
{},
|
||||
Notification.prototype.events,
|
||||
{'click .o_view_reload': function(e){
|
||||
{'click .o_notification_reload_view': function(e){
|
||||
e.preventDefault();
|
||||
this.reload_active_view();
|
||||
}
|
||||
},
|
||||
'click .o_notification_do_action': function(e){
|
||||
e.preventDefault();
|
||||
this.button_do_action();
|
||||
}
|
||||
}
|
||||
),
|
||||
init: function(parent, title, text, sticky, options) {
|
||||
@@ -25,6 +29,10 @@ odoo.define('web_notify.notification', function (require) {
|
||||
reload_active_view: function() {
|
||||
this.trigger_up('reload_active_view');
|
||||
},
|
||||
button_do_action: function() {
|
||||
console.log(this.options.action);
|
||||
this.getParent().do_action(this.options.action);
|
||||
}
|
||||
});
|
||||
|
||||
base_notification.NotificationManager.include({
|
||||
|
||||
Reference in New Issue
Block a user