From 29bc72133f58ff0b27daa68681bbd2aee7b9ec13 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20=C3=89vrard?= Date: Thu, 19 Sep 2024 11:09:47 +0200 Subject: [PATCH] Deactivate only the class buttons in x2M widgets Closes #13530 (grafted from 006b4deb180064214fed8bb9a2e1119c01fb68f7) --HG-- branch : 6.0 --- .../gui/window/view_form/view/list_gtk/widget.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/tryton/tryton/gui/window/view_form/view/list_gtk/widget.py b/tryton/tryton/gui/window/view_form/view/list_gtk/widget.py index 7f5bed0aad..71c78ec4f8 100644 --- a/tryton/tryton/gui/window/view_form/view/list_gtk/widget.py +++ b/tryton/tryton/gui/window/view_form/view/list_gtk/widget.py @@ -1323,12 +1323,13 @@ class Button(Cell): cell.set_property('visible', not invisible) readonly = record.readonly or states.get('readonly', False) cell.set_property('sensitive', not readonly) - parent = record.parent if record else None - while parent: - if parent.modified: - cell.set_property('sensitive', False) - break - parent = parent.parent + if self.attrs.get('type', 'class') == 'class': + parent = record.parent if record else None + while parent: + if parent.modified: + cell.set_property('sensitive', False) + break + parent = parent.parent # TODO icon self._set_visual(cell, record)