diff --git a/addons/mail/mail_thread_view.xml b/addons/mail/mail_thread_view.xml index a232aa12642..4106eb2e024 100644 --- a/addons/mail/mail_thread_view.xml +++ b/addons/mail/mail_thread_view.xml @@ -42,7 +42,8 @@ + 'read_action': 'read', + 'show_compose_message': False }""/>

No private message. @@ -64,7 +65,8 @@ + 'read_action': 'read', + 'compose_as_todo': True }""/>

No todo. @@ -84,7 +86,8 @@ } + 'view_mailbox': True, + 'show_compose_message': False }""/>

No message found and no message sent yet. diff --git a/addons/mail/static/src/js/mail.js b/addons/mail/static/src/js/mail.js index 9fcf8cbb7c5..155b379b2e2 100644 --- a/addons/mail/static/src/js/mail.js +++ b/addons/mail/static/src/js/mail.js @@ -952,7 +952,7 @@ openerp.mail = function (session) { this.options = options.options; this.options.root_thread = (options.options.root_thread != undefined ? options.options.root_thread : this); - this.options.show_compose_message = this.options.show_compose_message && (this.options.display_indented_thread >= this.thread_level || !this.thread_level); + this.options.show_compose_message = this.options.show_compose_message && !this.thread_level; // record options and data this.parent_message= parent.thread!= undefined ? parent : false ; @@ -989,7 +989,7 @@ openerp.mail = function (session) { // add message composition form view if (!this.compose_message) { this.compose_message = new mail.ThreadComposeMessage(this, this, { - 'context': this.context, + 'context': this.options.compose_as_todo && !this.thread_level ? _.extend(this.context, { 'default_favorite_user_ids': [this.session.uid] }) : this.context, 'options': this.options, }); if (!this.thread_level || this.thread_level > this.options.display_indented_thread) { @@ -1398,6 +1398,7 @@ openerp.mail = function (session) { * When you use this option, the domain is not used for the fetch root. * @param {String} [no_message] Message to display when there are no message * @param {Boolean} [show_link_partner] Display partner (authors, followers...) on link or not + * @param {Boolean} [compose_as_todo] The root composer mark automatically the message as todo */ init: function (parent, action) { this._super(parent, action); @@ -1418,6 +1419,7 @@ openerp.mail = function (session) { 'show_link_partner': true, 'view_inbox': false, 'message_ids': undefined, + 'compose_as_todo' : false, }, this.action.params); this.action.params.help = this.action.help || false;