mirror of
https://github.com/OCA/web.git
synced 2025-02-22 13:21:25 +02:00
[FIX] web_notify attempt to fix void messages (#1249)
It seems besides the custom channels provided in this addon it also catches messages from other channels. E.g. in this case it seems the void popup is triggered by these activity creation bus messages.
**Steps to reproduce**
Odoo commit: could reproduce on 5e8b667951 and 4da82776ff
OCA/web commit: 2465278
* Install crm and web_notify modules
* Create an activity for yourself (tried for admin user)
* Empty popup appears
**Attempt to solve**
It seems the bus handles all messages non exclusively. I've hacked in a conditional to handle only messages from web_notify addon, but its unclear wether this does not break something else.
This commit is contained in:
committed by
David
parent
8c1a13aeb0
commit
9f8d05d7d6
@@ -19,6 +19,13 @@ odoo.define('web_notify.WebClient', function (require) {
|
||||
this.channel_warning = 'notify_warning_' + session.uid;
|
||||
this.channel_info = 'notify_info_' + session.uid;
|
||||
this.channel_default = 'notify_default_' + session.uid;
|
||||
this.all_channels = [
|
||||
this.channel_success,
|
||||
this.channel_danger,
|
||||
this.channel_warning,
|
||||
this.channel_info,
|
||||
this.channel_default,
|
||||
];
|
||||
this.call('bus_service', 'addChannel', this.channel_success);
|
||||
this.call('bus_service', 'addChannel', this.channel_danger);
|
||||
this.call('bus_service', 'addChannel', this.channel_warning);
|
||||
@@ -32,9 +39,14 @@ odoo.define('web_notify.WebClient', function (require) {
|
||||
bus_notification: function (notifications) {
|
||||
var self = this;
|
||||
_.each(notifications, function (notification) {
|
||||
// Not used: var channel = notification[0];
|
||||
var channel = notification[0];
|
||||
var message = notification[1];
|
||||
if (
|
||||
self.all_channels != null &&
|
||||
self.all_channels.indexOf(channel) > -1
|
||||
) {
|
||||
self.on_message(message);
|
||||
}
|
||||
});
|
||||
},
|
||||
on_message: function (message) {
|
||||
|
||||
Reference in New Issue
Block a user