details:   https://code.tryton.org/tryton/commit/e1574b21943a
branch:    7.8
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.
        (grafted from 9bd2b4e3d9411564cc0762caf9b4e00f8ec0c676)
diffstat:

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

diffs (28 lines):

diff -r 06b26507c48e -r e1574b21943a 
tryton/tryton/gui/window/view_form/view/list.py
--- a/tryton/tryton/gui/window/view_form/view/list.py   Tue Mar 03 18:33:24 
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