From a07eefe68990ee74df0e4131b58c7efb30ba1b56 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20=C3=89vrard?= Date: Thu, 27 Jun 2013 14:44:43 +0200 Subject: [PATCH] Set button insensitive when calling their callback review900002 --- tryton/gui/window/view_form/view/form.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tryton/gui/window/view_form/view/form.py b/tryton/gui/window/view_form/view/form.py index f544178eea..44124e4cac 100644 --- a/tryton/gui/window/view_form/view/form.py +++ b/tryton/gui/window/view_form/view/form.py @@ -168,4 +168,8 @@ class ViewForm(ParserView): self.screen.display() return else: - self.screen.button(widget.attrs) + widget.set_sensitive(False) + try: + self.screen.button(widget.attrs) + finally: + widget.set_sensitive(True)