Deactivate only the class buttons in x2M widgets

Closes #13530
This commit is contained in:
Nicolas Évrard
2024-09-19 11:09:47 +02:00
parent d13f40521f
commit 87ce09a7c7
@@ -1419,12 +1419,13 @@ class Button(Cell):
cell.set_property('visible', not invisible)
readonly = 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)