[IMP] mail follower: remove the unfollow partners button if the user can't edit the view

bzr revid: chm@openerp.com-20121220150112-ysmpkqv0bbx5shrk
This commit is contained in:
Christophe Matthieu
2012-12-20 16:01:12 +01:00
parent 1834be63f6
commit 2efed7e8f8
2 changed files with 3 additions and 3 deletions
+2 -2
View File
@@ -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');
});
},
@@ -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&amp;id=#{record.id}"><t t-raw="record.name"/></a>
<span class="oe_remove_follower oe_e" title="Remove this follower" t-att-data-id="record.id">X</span>
<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>
<!--