details:   https://code.tryton.org/tryton/commit/9bd2b4e3d941
branch:    default
user:      Cédric Krier <[email protected]>
date:      Tue Mar 03 18:50:22 2026 +0100
description:
        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.
diffstat:

 tryton/tryton/gui/window/view_form/view/list.py |  11 ++++++-----
 1 files changed, 6 insertions(+), 5 deletions(-)

diffs (28 lines):

diff -r dcd74e5a2ee9 -r 9bd2b4e3d941 
tryton/tryton/gui/window/view_form/view/list.py
--- a/tryton/tryton/gui/window/view_form/view/list.py   Tue Mar 03 18:37:56 
2026 +0100
+++ b/tryton/tryton/gui/window/view_form/view/list.py   Tue Mar 03 18:50:22 
2026 +0100
@@ -455,11 +455,11 @@
 
         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 @@
         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'

Reply via email to