[IMP] mail follower: don't display invite button if the user don't have write access. Use many2many_tags_email widget on composer

bzr revid: chm@openerp.com-20121221102649-xyecgj5tqd3li3hw
This commit is contained in:
Christophe Matthieu 2012-12-21 11:26:49 +01:00
parent 9df82da7c0
commit d36ef41a46
3 changed files with 5 additions and 4 deletions

View File

@ -34,6 +34,8 @@ openerp_mail_followers = function(session, mail) {
this.value = [];
this.followers = [];
this.view_is_editable = this.__parentedParent.is_action_enabled('edit');
},
start: function() {
@ -43,7 +45,6 @@ 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 () {

View File

@ -19,7 +19,7 @@
</t>
<div class='oe_follower_title_box'>
<h4 class='oe_follower_title'>Followers</h4>
<a href='#' class="oe_invite">Invite others</a>
<a t-if="widget.view_is_editable" href='#' class="oe_invite">Invite others</a>
</div>
<div class="oe_follower_list"></div>
</div>

View File

@ -11,8 +11,8 @@
<group>
<field name="res_model" invisible="1"/>
<field name="res_id" invisible="1"/>
<field name="partner_ids" widget="many2many_tags"
on_change="onchange_partner_ids(partner_ids)" />
<field name="partner_ids" widget="many2many_tags_email" placeholder="Add contacts to notify..."
context="{'force_email':True}"/>
<field name="message"/>
</group>
<footer>