details: https://code.tryton.org/tryton/commit/2c767215a72d
branch: 7.8
user: Cédric Krier <[email protected]>
date: Thu Dec 18 00:44:36 2025 +0100
description:
Do not create chat if there is not current reference
Closes #14427
(grafted from 6715ccac77ff30c5c517eb096d910f9b8b79ff89)
diffstat:
sao/src/tab.js | 8 +++++---
tryton/tryton/gui/window/form.py | 2 +-
2 files changed, 6 insertions(+), 4 deletions(-)
diffs (30 lines):
diff -r 3b9e37fe6b7e -r 2c767215a72d sao/src/tab.js
--- a/sao/src/tab.js Thu Dec 18 00:45:20 2025 +0100
+++ b/sao/src/tab.js Thu Dec 18 00:44:36 2025 +0100
@@ -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 -r 3b9e37fe6b7e -r 2c767215a72d tryton/tryton/gui/window/form.py
--- a/tryton/tryton/gui/window/form.py Thu Dec 18 00:45:20 2025 +0100
+++ b/tryton/tryton/gui/window/form.py Thu Dec 18 00:44:36 2025 +0100
@@ -265,7 +265,7 @@
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()