Now uses im.user's images

bzr revid: nicolas.vanhoren@openerp.com-20130826085212-od9oxv6h4jtkd6nf
This commit is contained in:
niv-openerp
2013-08-26 10:52:12 +02:00
parent 8f33049f2f
commit 7bce27c528
+2 -7
View File
@@ -32,13 +32,8 @@ function declare($, _, openerp) {
im_common.ImUser = openerp.Class.extend(openerp.PropertiesMixin, {
init: function(parent, user_rec) {
openerp.PropertiesMixin.init.call(this, parent);
user_rec.image_url = im_common.connection.url("/im/static/src/img/avatar/avatar.jpeg");
// TODO : check it works correctly
if (user_rec.user_id)
user_rec.image_url = im_common.connection.url('/web/binary/image', {model:'res.users', field: 'image_small', id: user_rec.user_id[0]});
/*if (user_rec.image)
user_rec.image_url = "data:image/png;base64," + user_rec.image;*/
user_rec.image_url = im_common.connection.url('/web/binary/image', {model:'im.user', field: 'image', id: user_rec.id});
this.set(user_rec);
this.set("watcher_count", 0);