From 05b4551799bc3df61da045009e467a5e330a94cb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Thu, 27 Nov 2025 01:14:59 +0100 Subject: [PATCH] Do not sum digits for widget width when some parts are unknown Closes #14384 (grafted from cd8a0670dd5c6274062e92a40a39509105c800ec) --HG-- branch : 7.0 --- sao/src/view/form.js | 2 +- tryton/tryton/gui/window/view_form/view/form_gtk/float.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sao/src/view/form.js b/sao/src/view/form.js index d5a372b7f9..d451cdaccb 100644 --- a/sao/src/view/form.js +++ b/sao/src/view/form.js @@ -2101,7 +2101,7 @@ function eval_pyson(value){ }, get width() { var digits = this.digits; - if (digits) { + if (digits && digits.every(d => d !== null)) { return digits.reduce(function(acc, cur) { return acc + cur; }); diff --git a/tryton/tryton/gui/window/view_form/view/form_gtk/float.py b/tryton/tryton/gui/window/view_form/view/form_gtk/float.py index f709518826..dc611170f7 100644 --- a/tryton/tryton/gui/window/view_form/view/form_gtk/float.py +++ b/tryton/tryton/gui/window/view_form/view/form_gtk/float.py @@ -14,7 +14,7 @@ class Float(Integer): @property def width(self): digits = self.digits - if digits: + if digits and all(d is not None for d in digits): return sum(digits) else: return self.attrs.get('width', 18)