From c5d2e432cd03669bc57c5de6c405532253bc4e34 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Tue, 14 Nov 2023 00:31:12 +0100 Subject: [PATCH] Render button as readonly in tryton list if the record is readonly Closes #12741 (grafted from b11135a06b2ee04f0ef27f431a44e638d55675a3) --HG-- branch : 6.0 --- tryton/tryton/gui/window/view_form/view/list_gtk/widget.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 faa574838a..076f1642aa 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 @@ -1301,7 +1301,7 @@ class Button(Cell): states = record.expr_eval(self.attrs.get('states', {})) invisible = states.get('invisible', False) cell.set_property('visible', not invisible) - readonly = states.get('readonly', False) + readonly = record.readonly or states.get('readonly', False) cell.set_property('sensitive', not readonly) parent = record.parent if record else None while parent: