From 39ddf8b838f4b5363e3d3bee34376a6b1ecce4c9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Wed, 30 Apr 2025 17:22:58 +0200 Subject: [PATCH] Update label of window form only if it exists The update of label was introduced in 89834116fe97 but the label is defined only when the window form is created with the view type tree. Closes #13994 --- sao/src/window.js | 4 +++- tryton/tryton/gui/window/win_form.py | 3 ++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/sao/src/window.js b/sao/src/window.js index 15e806b75f..8871e64a9b 100644 --- a/sao/src/window.js +++ b/sao/src/window.js @@ -416,7 +416,9 @@ } } let message = name + '/' + Sao.common.humanize(size); - this.label.text(message).attr('title', message); + if (this.label) { + this.label.text(message).attr('title', message); + } this._set_button_sensitive(); }, record_modified: function() { diff --git a/tryton/tryton/gui/window/win_form.py b/tryton/tryton/gui/window/win_form.py index b418bfd68d..8edf436f9f 100644 --- a/tryton/tryton/gui/window/win_form.py +++ b/tryton/tryton/gui/window/win_form.py @@ -365,7 +365,8 @@ class WinForm(NoModal, InfoBar): if selected > 1: name += '#%i' % selected name = '(%s/%s)' % (name, common.humanize(size)) - self.label.set_text(name) + if hasattr(self, 'label'): + self.label.set_text(name) self._set_button_sensitive() def record_modified(self, *args):