From 2b5036c8f593f8f8d062885ab24c3f775099e22d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Mon, 12 Mar 2012 15:37:23 +0100 Subject: [PATCH] Deactivate buttons if parent was modified issue1809 review265001 --- tryton/common/button.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tryton/common/button.py b/tryton/common/button.py index b437058ad0..2adae35ba6 100644 --- a/tryton/common/button.py +++ b/tryton/common/button.py @@ -37,3 +37,9 @@ class Button(gtk.Button): self.show() self.set_sensitive(not states.get('readonly', False)) self._set_icon(states.get('icon', self.attrs.get('icon'))) + parent = record.parent if record else None + while parent: + if parent.modified: + self.set_sensitive(False) + break + parent = parent.parent