diff --git a/addons/mail/static/src/js/mail.js b/addons/mail/static/src/js/mail.js index 71665bc69fb..a7243dc90a9 100644 --- a/addons/mail/static/src/js/mail.js +++ b/addons/mail/static/src/js/mail.js @@ -615,12 +615,15 @@ openerp.mail = function(session) { // update domain var domain = this.options.domain.concat([['model', '=', this.view.model], ['res_id', '=', this.view.datarecord.id]]); // create and render Thread widget + var show_header_compose = this.view.is_action_enabled('edit') || + (this.getParent().fields.message_is_follower && this.getParent().fields.message_is_follower.get_value()); this.$el.find('div.oe_mail_recthread_main').empty(); var thread = new mail.Thread(self, domain, this.options.context, { 'thread_level': this.options.thread_level, - 'use_composer': true, + 'show_header_compose': show_header_compose, + 'use_composer': show_header_compose, 'show_dd_delete': true, - 'show_reply_by_email': true }); + 'show_reply_by_email': show_header_compose }); return thread.appendTo(this.$el.find('div.oe_mail_recthread_main')); }, }); diff --git a/addons/mail/static/src/js/mail_followers.js b/addons/mail/static/src/js/mail_followers.js index e1ecad3765d..b321ca42027 100644 --- a/addons/mail/static/src/js/mail_followers.js +++ b/addons/mail/static/src/js/mail_followers.js @@ -89,7 +89,7 @@ openerp_mail_followers = function(session, mail) { fetch_followers: function (value_) { this.value = value_; - this.message_is_follower = this.getParent().fields.message_is_follower && this.getParent().fields.message_is_follower.get_value() || undefined; + this.message_is_follower = this.getParent().fields.message_is_follower && this.getParent().fields.message_is_follower.get_value(); return this.ds_follow.call('read', [value_, ['name', 'user_ids']]).pipe(this.proxy('display_followers'), this.proxy('display_generic')); }, @@ -126,8 +126,11 @@ openerp_mail_followers = function(session, mail) { display_buttons: function () { this.$('button.oe_mail_button_follow').hide(); this.$('button.oe_mail_button_unfollow').hide(); + this.$('button.oe_mail_button_invite').hide(); + if (! this.view.is_action_enabled('edit')) return; + this.$('button.oe_mail_button_invite').show(); if (this.message_is_follower) { this.$('button.oe_mail_button_unfollow').show(); } - else if (this.message_is_follow == false) { this.$('button.oe_mail_button_unfollow').hide(); } + else if (this.message_is_follower == false) { this.$('button.oe_mail_button_follow').show(); } }, do_follow: function () { diff --git a/addons/mail/static/src/xml/mail_followers.xml b/addons/mail/static/src/xml/mail_followers.xml index 32ce34d48d1..8e4c4b3991f 100644 --- a/addons/mail/static/src/xml/mail_followers.xml +++ b/addons/mail/static/src/xml/mail_followers.xml @@ -7,9 +7,9 @@ -->