diff --git a/static/src/js/mail_message.js b/static/src/js/mail_message.js index 7b020bb2dd314fe09cfc08c0c6135f9abe83fd03..5906ebc574421629655bca9b6b40cce030c5aa1b 100755 --- a/static/src/js/mail_message.js +++ b/static/src/js/mail_message.js @@ -23,6 +23,11 @@ odoo.define('cgscop_mail_message.MailMessage',function(require){ var commands = this.options.commandsEnabled ? this._mentionManager.getListenerSelection('/') : []; + if (this.$('#oe_restricted_message').length) { + var is_restricted = this.$('#oe_restricted_message')[0].checked + } else { + var is_restricted = false + } return $.when({ content: this._mentionManager.generateLinks(value), attachment_ids: _.pluck(this.get('attachment_ids'), 'id'), @@ -30,7 +35,7 @@ odoo.define('cgscop_mail_message.MailMessage',function(require){ canned_response_ids: _.uniq(_.pluck(this._mentionManager.getListenerSelections()[':'], 'id')), channel_ids: _.uniq(_.pluck(this._mentionManager.getListenerSelection('#'), 'id')), command: commands.length > 0 ? commands[0].name : undefined, - restricted: this.$('#oe_restricted_message')[0].checked, + restricted: is_restricted }); },