details: https://code.tryton.org/tryton/commit/1536161042e5
branch: 7.6
user: Cédric Krier <[email protected]>
date: Thu Nov 27 01:14:59 2025 +0100
description:
Do not sum digits for widget width when some parts are unknown
Closes #14384
(grafted from cd8a0670dd5c6274062e92a40a39509105c800ec)
diffstat:
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(-)
diffs (24 lines):
diff -r 1eb8d837c255 -r 1536161042e5 sao/src/view/form.js
--- a/sao/src/view/form.js Tue Nov 04 10:28:04 2025 +0100
+++ b/sao/src/view/form.js Thu Nov 27 01:14:59 2025 +0100
@@ -2204,7 +2204,7 @@
},
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 -r 1eb8d837c255 -r 1536161042e5
tryton/tryton/gui/window/view_form/view/form_gtk/float.py
--- a/tryton/tryton/gui/window/view_form/view/form_gtk/float.py Tue Nov 04
10:28:04 2025 +0100
+++ b/tryton/tryton/gui/window/view_form/view/form_gtk/float.py Thu Nov 27
01:14:59 2025 +0100
@@ -14,7 +14,7 @@
@property
def width(self):
digits = self.digits
- if digits and all(digits):
+ if digits and all(d is not None for d in digits):
return sum(digits)
else:
return self.attrs.get('width', 18)