diff options
Diffstat (limited to 'addons/mail/static/src')
| -rw-r--r-- | addons/mail/static/src/js/mail_followers.js | 8 | ||||
| -rw-r--r-- | addons/mail/static/src/xml/mail_followers.xml | 2 |
2 files changed, 7 insertions, 3 deletions
diff --git a/addons/mail/static/src/js/mail_followers.js b/addons/mail/static/src/js/mail_followers.js index 93f8f995ec7..09f54f012ce 100644 --- a/addons/mail/static/src/js/mail_followers.js +++ b/addons/mail/static/src/js/mail_followers.js @@ -192,14 +192,18 @@ openerp_mail_followers = function(session, mail) { var self = this; this.followers = records || this.followers; this.message_is_follower = this.set_is_follower(this.followers); + this.check_access = false; // clean and display title var node_user_list = this.$('.oe_follower_list').empty(); this.$('.oe_follower_title').html(this._format_followers(this.followers.length)); // truncate number of displayed followers var truncated = this.followers.slice(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, 'widget': self})).appendTo(node_user_list); + self.ds_model.call('check_access_right', [self.session.uid]).then(function(result){ + self.check_access = result; + record.avatar_url = mail.ChatterUtils.get_image(self.session, 'res.partner', 'image_small', record.id); + $(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 < this.followers.length) { diff --git a/addons/mail/static/src/xml/mail_followers.xml b/addons/mail/static/src/xml/mail_followers.xml index 88f38146de3..ca0064cbc78 100644 --- a/addons/mail/static/src/xml/mail_followers.xml +++ b/addons/mail/static/src/xml/mail_followers.xml @@ -31,7 +31,7 @@ <div t-name="mail.followers.partner" class='oe_partner'> <img class="oe_mail_thumbnail oe_mail_frame" t-attf-src="{record.avatar_url}"/> <a t-attf-href="#model=res.partner&id=#{record.id}" t-att-title="record.name"><t t-esc="record.name"/></a> - <img t-if="widget.session.debug" class="oe_edit_subtype" t-att-src='_s + "/mail/static/src/img/icon-edit.gif"' title="Edit Subtype" t-att-data-id="record.id"/> + <img t-if="widget.session.debug and widget.check_access" class="oe_edit_subtype" t-att-src='_s + "/mail/static/src/img/icon-edit.gif"' title="Edit Subtype" t-att-data-id="record.id"/> <span t-if="widget.view_is_editable" class="oe_remove_follower oe_e" title="Remove this follower" t-att-data-id="record.id">X</span> </div> |
