Render button as readonly in tryton list if the record is readonly

Closes #12741
This commit is contained in:
Cédric Krier committed 2023-11-14 00:31:12 +01:00
1 parent 6ebbe6d5d7
commit 2e31d458e1
1 file changed
+1 -1
@@ -1383,7 +1383,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: