From 8e12aa010bcf5a4aba94864e7fd005ce11289b52 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Thu, 18 Dec 2025 00:44:36 +0100 Subject: [PATCH] Do not create chat if there is not current reference Closes #14427 --- sao/src/tab.js | 8 +++++--- tryton/tryton/gui/window/form.py | 2 +- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/sao/src/tab.js b/sao/src/tab.js index 0f85e951ba..20ee134746 100644 --- a/sao/src/tab.js +++ b/sao/src/tab.js @@ -1406,9 +1406,11 @@ if (chat.length) { chat.remove(); } else { - this._chat = new Sao.Chat(this.screen.current_reference); - this._chat.refresh(); - this.sidebar_content.append(this._chat.el); + if (this.screen.current_reference) { + this._chat = new Sao.Chat(this.screen.current_reference); + this._chat.refresh(); + this.sidebar_content.append(this._chat.el); + } } this.update_sidebar(); }, diff --git a/tryton/tryton/gui/window/form.py b/tryton/tryton/gui/window/form.py index 3d9ac50b6f..9eef4a4a26 100644 --- a/tryton/tryton/gui/window/form.py +++ b/tryton/tryton/gui/window/form.py @@ -265,7 +265,7 @@ class Form(TabContent): button.props.active = True return - if button.get_active(): + if button.get_active() and self.screen.current_reference: self._chat = Chat(self.screen.current_reference) self.chat.pack_start(self._chat.widget, True, True, padding=3) self.chat.show_all()