From ae94f028ade4206520a5758a7600acc9892a91df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Fri, 14 Nov 2008 20:25:21 +0100 Subject: [PATCH] Set sensitive on save button depending of the value of field binary for issue574 --- tryton/gui/window/view_form/view/form_gtk/binary.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tryton/gui/window/view_form/view/form_gtk/binary.py b/tryton/gui/window/view_form/view/form_gtk/binary.py index a48543950a..58f90aa83d 100644 --- a/tryton/gui/window/view_form/view/form_gtk/binary.py +++ b/tryton/gui/window/view_form/view/form_gtk/binary.py @@ -107,9 +107,11 @@ class Binary(WidgetInterface): super(Binary, self).display(model, model_field) if not model_field: self.wid_text.set_text('') + self.but_save_as.set_sensitive(False) return False self.model_field = model_field self.wid_text.set_text(self._size_get(model_field.get(model))) + self.but_save_as.set_sensitive(bool(model_field.get(model))) return True def _size_get(self, value):