From 7885518850ab0d615e157ae789f8519bc3eac3be Mon Sep 17 00:00:00 2001
From: Christophe Matthieu
Date: Wed, 14 Nov 2012 16:30:22 +0100
Subject: [PATCH] [FIX] mail: insert new message on the wall and indented the
reply of this message
bzr revid: chm@openerp.com-20121114153022-i6xv4v2jqxx8w39r
---
addons/mail/data/mail_group_data.xml | 8 +++++---
addons/mail/static/src/js/mail.js | 11 ++++++-----
2 files changed, 11 insertions(+), 8 deletions(-)
diff --git a/addons/mail/data/mail_group_data.xml b/addons/mail/data/mail_group_data.xml
index e08e89cf474..8d4a89a0a36 100644
--- a/addons/mail/data/mail_group_data.xml
+++ b/addons/mail/data/mail_group_data.xml
@@ -15,9 +15,11 @@
notification
Welcome to OpenERP!
- Your homepage is a summary of messages you received and key information about documents you follow.
-The top menu bar contains all applications you installed. You can use this <i>Settings</i> menu to install more applications, activate others features or give access to new users.
-To setup your preferences (name, email signature, avatar), click on the top right corner.
]]>
+ Your homepage is a summary of messages you received and key information about documents you follow.
+ The top menu bar contains all applications you installed. You can use this Settings menu to install more applications, activate others features or give access to new users.
+ To setup your preferences (name, email signature, avatar), click on the top right corner.
+ ]]>
diff --git a/addons/mail/static/src/js/mail.js b/addons/mail/static/src/js/mail.js
index 66fdf25039d..21668b2aed8 100644
--- a/addons/mail/static/src/js/mail.js
+++ b/addons/mail/static/src/js/mail.js
@@ -599,16 +599,15 @@ openerp.mail = function (session) {
this.parent_thread.context
]).done(function (record) {
var thread = self.parent_thread;
-
if (self.options.display_indented_thread < self.thread_level && thread.parent_message) {
- thread = thread.parent_message.parent_thread;
+ var hread = thread.parent_message.parent_thread;
}
+ var root = thread == self.options.root_thread;
// create object and attach to the thread object
thread.message_fetch([['id', 'child_of', [self.id]]], false, [record], function (arg, data) {
- data[0].no_sorted = true;
var message = thread.create_message_object( data[0] );
// insert the message on dom
- thread.insert_message( message, self.$el );
+ thread.insert_message( message, root ? undefined : self.$el, root );
if (thread.parent_message) {
self.$el.remove();
self.parent_thread.compose_message = null;
@@ -1261,7 +1260,7 @@ openerp.mail = function (session) {
* The sort is define by the thread_level (O for newer on top).
* @param : {object} ThreadMessage object
*/
- insert_message: function (message, dom_insert_after) {
+ insert_message: function (message, dom_insert_after, prepend) {
var self=this;
if (this.options.show_compact_message > this.thread_level) {
this.instantiate_compose_message();
@@ -1273,6 +1272,8 @@ openerp.mail = function (session) {
if (dom_insert_after) {
message.insertAfter(dom_insert_after);
+ }if (prepend) {
+ message.prependTo(self.$el);
} else {
message.appendTo(self.$el);
}