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

Closes #12741
(grafted from b11135a06b2ee04f0ef27f431a44e638d55675a3)

--HG--
branch : 6.0
This commit is contained in:
Cédric Krier committed 2023-11-14 00:31:12 +01:00
1 parent bb06f47f81
commit c5d2e432cd
1 file changed
+1 -1
@@ -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: