From 2efed7e8f8193cbf053d2c05c685dc5f22797919 Mon Sep 17 00:00:00 2001 From: Christophe Matthieu Date: Thu, 20 Dec 2012 16:01:12 +0100 Subject: [PATCH] [IMP] mail follower: remove the unfollow partners button if the user can't edit the view bzr revid: chm@openerp.com-20121220150112-ysmpkqv0bbx5shrk --- addons/mail/static/src/js/mail_followers.js | 4 ++-- addons/mail/static/src/xml/mail_followers.xml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/addons/mail/static/src/js/mail_followers.js b/addons/mail/static/src/js/mail_followers.js index f0114be33f4..032ae386660 100644 --- a/addons/mail/static/src/js/mail_followers.js +++ b/addons/mail/static/src/js/mail_followers.js @@ -41,6 +41,7 @@ openerp_mail_followers = function(session, mail) { this.reinit(); this.bind_events(); this._super(); + this.view_is_editable = this.__parentedParent.is_action_enabled('edit'); }, on_check_visibility_mode: function () { @@ -165,7 +166,7 @@ openerp_mail_followers = function(session, mail) { var truncated = records.splice(0, this.displayed_nb); _(truncated).each(function (record) { record.avatar_url = mail.ChatterUtils.get_image(self.session, 'res.partner', 'image_small', record.id); - $(session.web.qweb.render('mail.followers.partner', {'record': record})).appendTo(node_user_list); + $(session.web.qweb.render('mail.followers.partner', {'record': record, 'widget': self})).appendTo(node_user_list); }); // FVA note: be sure it is correctly translated if (truncated.length < records.length) { @@ -222,7 +223,6 @@ openerp_mail_followers = function(session, mail) { .then(this.proxy('read_value')); _.each(this.$('.oe_subtype_list input'), function (record) { - console.log(record); $(record).attr('checked', 'checked'); }); }, diff --git a/addons/mail/static/src/xml/mail_followers.xml b/addons/mail/static/src/xml/mail_followers.xml index 377ed527cc1..08334123d8a 100644 --- a/addons/mail/static/src/xml/mail_followers.xml +++ b/addons/mail/static/src/xml/mail_followers.xml @@ -31,7 +31,7 @@
- X + X