From 699672a0ff474f4550d92657ab22f9c92c7b3b42 Mon Sep 17 00:00:00 2001
From: Ipsita Borisagar <ibo@odoo.com>
Date: Fri, 5 Feb 2021 04:44:38 +0000
Subject: [PATCH] [FIX] mail: fix alignement for chatter in window
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Before this commit:

For chatter in window, the name of the record is not in an appropriate place in
header as there is an empty space before name.

After this commit:

The name of the record is aligned to the left, and there is no empty space
before the name.

LINKS

Task- 2442652
PR https://github.com/odoo/odoo/pull/65600

closes odoo/odoo#65600

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
---
 .../src/components/chat_window_header/chat_window_header.js     | 1 +
 .../src/components/chat_window_header/chat_window_header.xml    | 2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/addons/mail/static/src/components/chat_window_header/chat_window_header.js b/addons/mail/static/src/components/chat_window_header/chat_window_header.js
index eb41190b1e84..ea560ca21f1e 100644
--- a/addons/mail/static/src/components/chat_window_header/chat_window_header.js
+++ b/addons/mail/static/src/components/chat_window_header/chat_window_header.js
@@ -29,6 +29,7 @@ class ChatWindowHeader extends Component {
                 thread,
                 threadLocalMessageUnreadCounter: thread && thread.localMessageUnreadCounter,
                 threadMassMailing: thread && thread.mass_mailing,
+                threadModel: thread && thread.model,
             };
         });
     }
diff --git a/addons/mail/static/src/components/chat_window_header/chat_window_header.xml b/addons/mail/static/src/components/chat_window_header/chat_window_header.xml
index 99f982408b72..b922da159ae5 100644
--- a/addons/mail/static/src/components/chat_window_header/chat_window_header.xml
+++ b/addons/mail/static/src/components/chat_window_header/chat_window_header.xml
@@ -9,7 +9,7 @@
                         <i class="fa fa-arrow-left"/>
                     </div>
                 </t>
-                <t t-if="chatWindow.thread">
+                <t t-if="chatWindow.thread and chatWindow.thread.model === 'mail.channel'">
                     <ThreadIcon
                         class="o_ChatWindowHeader_icon o_ChatWindowHeader_item"
                         threadLocalId="chatWindow.thread.localId"
-- 
GitLab