From efaaf3513be3b8946cf9f51400cbc6d6d29a0a33 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Tue, 3 Mar 2026 18:50:22 +0100 Subject: [PATCH] Do not use attribute width as computed width and restore computed width on reset If the attribute width (which is the user width) is used as computed width, on reset of the widths the custom widths are still in used. --- tryton/tryton/gui/window/view_form/view/list.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/tryton/tryton/gui/window/view_form/view/list.py b/tryton/tryton/gui/window/view_form/view/list.py index a31c26d0d2..02a5c8fff0 100644 --- a/tryton/tryton/gui/window/view_form/view/list.py +++ b/tryton/tryton/gui/window/view_form/view/list.py @@ -455,11 +455,11 @@ class TreeXMLViewParser(XMLViewParser): screen = self.view.screen width = screen.tree_column_width[screen.model_name].get(column.name) - if not width: - if 'width' in attributes: - computed_width = width = int(attributes['width']) - else: - width = computed_width + if width or attributes.get('width'): + if not width: + width = int(attributes['width']) + else: + width = computed_width column.width = width column.computed_width = computed_width if width > 0: @@ -619,6 +619,7 @@ class ViewTree(View): for col in self.treeview.get_columns(): if col.name: col.set_fixed_width(col.computed_width) + col.width = col.computed_width def get_column_widget(self, column): 'Return the widget of the column'