From 7ac121b54d1791ff429d8ca0a39827fd52cd9a59 Mon Sep 17 00:00:00 2001 From: Zelong Lin Date: Tue, 17 Oct 2023 14:30:10 +0200 Subject: [PATCH] [FIX] web,mail: correspondent can be null MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Correspondent in thread can be null and lead into crash when getting thread action and im status. Replace correspondent with chatPartner when type is chat. The fix is to solve the problem so that it is not blocking systray and chatWindow tests related. Also, this fix small issue of systray overflowing issue. closes odoo/odoo#138913 Signed-off-by: Alexandre Kühn (aku) --- addons/hr/static/src/core/web/thread_actions.js | 2 +- addons/mail/static/src/core/common/chat_window.xml | 2 +- addons/mail/static/src/core/common/discuss.xml | 2 +- addons/mail/static/src/core/web/messaging_menu.scss | 2 +- addons/mail/static/src/core/web/messaging_menu.xml | 2 +- addons/web/static/src/scss/primary_variables.scss | 1 + addons/web/static/src/scss/ui.scss | 2 +- 7 files changed, 7 insertions(+), 6 deletions(-) diff --git a/addons/hr/static/src/core/web/thread_actions.js b/addons/hr/static/src/core/web/thread_actions.js index db9836d8c1a..f3d5a35ae77 100644 --- a/addons/hr/static/src/core/web/thread_actions.js +++ b/addons/hr/static/src/core/web/thread_actions.js @@ -10,7 +10,7 @@ threadActionsRegistry.add("open-hr-profile", { return ( component.thread?.type === "chat" && component.props.chatWindow?.isOpen && - component.thread.correspondent.employeeId + component.thread.chatPartner.employeeId ); }, icon: "fa fa-fw fa-id-card", diff --git a/addons/mail/static/src/core/common/chat_window.xml b/addons/mail/static/src/core/common/chat_window.xml index 6b1063d596b..8bc58375020 100644 --- a/addons/mail/static/src/core/common/chat_window.xml +++ b/addons/mail/static/src/core/common/chat_window.xml @@ -81,7 +81,7 @@
Thread Image
- +
diff --git a/addons/mail/static/src/core/common/discuss.xml b/addons/mail/static/src/core/common/discuss.xml index 51c7720c670..b9859ded5cd 100644 --- a/addons/mail/static/src/core/common/discuss.xml +++ b/addons/mail/static/src/core/common/discuss.xml @@ -19,7 +19,7 @@ - +
- + diff --git a/addons/web/static/src/scss/primary_variables.scss b/addons/web/static/src/scss/primary_variables.scss index 2ee69b95add..07be71e119f 100644 --- a/addons/web/static/src/scss/primary_variables.scss +++ b/addons/web/static/src/scss/primary_variables.scss @@ -186,6 +186,7 @@ $o-horizontal-padding: $o-spacer !default; $o-innergroup-rpadding: 45px !default; $o-dropdown-hpadding: 20px !default; $o-dropdown-vpadding: 3px !default; +$o-dropdown-max-height: 70vh !default; $o-statbutton-height: 44px !default; $o-statbutton-vpadding: 0px !default; diff --git a/addons/web/static/src/scss/ui.scss b/addons/web/static/src/scss/ui.scss index ce6cd49e84b..8a118920efe 100644 --- a/addons/web/static/src/scss/ui.scss +++ b/addons/web/static/src/scss/ui.scss @@ -17,7 +17,7 @@ } .dropdown-menu { - max-height: 70vh; + max-height: $o-dropdown-max-height; overflow: auto; background-clip: border-box; }