'message': warning_msg,
}
}
+
+class ir_actions_client(osv.Model):
+
+ _inherit = 'ir.actions.client'
+
+ def check_message_security(self, cr, uid, context=None):
+ flag = False
+ group = self.pool.get('ir.model.data').get_object_reference(cr, uid, 'base', 'group_user')
+ if group:
+ users = self.pool.get('res.groups').read(cr, uid, group[1], ['users'])['users']
+ flag = uid in users and True or False
+ return flag
template: 'mail.record_thread',
init: function (parent, node) {
+ var self = this;
this._super.apply(this, arguments);
this.ParentViewManager = parent;
this.node = _.clone(node);
'read_action': 'unread',
'show_record_name': false,
'show_compact_message': 1,
+ 'display_log_button' : false,
}, this.node.params);
-
if (this.node.attrs.placeholder) {
this.node.params.compose_placeholder = this.node.attrs.placeholder;
}
if (!this.ParentViewManager.is_action_enabled('edit')) {
this.node.params.show_link = false;
}
+ this.dataset = new session.web.DataSet(this,"ir.actions.client");
+ this.dataset.call('check_message_security', [this.session.uid]).then(function(result){
+ self.node.params.display_log_button = result;
+ });
},
start: function () {
<div class="field_text oe_compact oe_compact_record">
<a class="oe_compose_post" t-if="widget.options.compose_placeholder"><t t-raw="widget.options.compose_placeholder"/></a>
<a class="oe_compose_post" t-if="!widget.options.compose_placeholder and !widget.options.view_mailbox">Send a message</a>
- <span class="oe_grey oe_sep_word">or</span>
- <a class="oe_compose_log">Log a note</a>
+ <t t-if="widget.options.display_log_button">
+ <span class="oe_grey oe_sep_word">or</span>
+ <a class="oe_compose_log">Log a note</a>
+ </t>
</div>
</t>
</div>