[FIX] im_chat : enable chat widget only for base.group_user
This commit is contained in:
parent
c9a134b541
commit
2942492245
|
@ -582,7 +582,10 @@
|
||||||
openerp.web.UserMenu.include({
|
openerp.web.UserMenu.include({
|
||||||
do_update: function(){
|
do_update: function(){
|
||||||
var self = this;
|
var self = this;
|
||||||
this.update_promise.then(function() {
|
var Users = new openerp.web.Model('res.users');
|
||||||
|
Users.call('has_group', ['base.group_user']).done(function(is_employee) {
|
||||||
|
if (is_employee) {
|
||||||
|
self.update_promise.then(function() {
|
||||||
var im = new openerp.im_chat.InstantMessaging(self);
|
var im = new openerp.im_chat.InstantMessaging(self);
|
||||||
openerp.im_chat.single = im;
|
openerp.im_chat.single = im;
|
||||||
im.appendTo(openerp.client.$el);
|
im.appendTo(openerp.client.$el);
|
||||||
|
@ -590,6 +593,8 @@
|
||||||
button.on("clicked", im, im.switch_display);
|
button.on("clicked", im, im.switch_display);
|
||||||
button.appendTo(window.$('.oe_systray'));
|
button.appendTo(window.$('.oe_systray'));
|
||||||
});
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
return this._super.apply(this, arguments);
|
return this._super.apply(this, arguments);
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue