From e8a34de7285093ee9b9de898cb98c802a834e691 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Tue, 2 Aug 2011 12:40:45 +0200 Subject: [PATCH] Don't run twice Wizard.process if it is waiting for responce --- tryton/gui/window/nomodal.py | 2 +- tryton/gui/window/wizard.py | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/tryton/gui/window/nomodal.py b/tryton/gui/window/nomodal.py index ef0b208c64..c100e2b596 100644 --- a/tryton/gui/window/nomodal.py +++ b/tryton/gui/window/nomodal.py @@ -22,7 +22,7 @@ class NoModal(object): def destroy(self): self.page.dialogs.remove(self) - self.sensible_widget.props.sensitive = True self.parent.present() + self.sensible_widget.props.sensitive = True if self.parent_focus: self.parent_focus.grab_focus() diff --git a/tryton/gui/window/wizard.py b/tryton/gui/window/wizard.py index 0ba252d2eb..2dd83b4be1 100644 --- a/tryton/gui/window/wizard.py +++ b/tryton/gui/window/wizard.py @@ -33,6 +33,7 @@ class Wizard(object): self.states = {} self.response2state = {} self.__processing = False + self.__waiting_response = False def run(self, action, datas, state='init', direct_print=False, email_print=False, email=None, context=None): @@ -57,7 +58,7 @@ class Wizard(object): def process(self): from tryton.action import Action res = {} - if self.__processing: + if self.__processing or self.__waiting_response: return try: self.__processing = True @@ -87,6 +88,7 @@ class Wizard(object): self.clean() self.update(res, res['state'], res['object'], context=ctx) self.screen.current_record.set_default(self.datas['form']) + self.__waiting_response = True break elif res['type'] == 'action': self.state = res['state'] @@ -144,6 +146,7 @@ class Wizard(object): self.states = {} def response(self, widget, response): + self.__waiting_response = False state = self.response2state.get(response, 'end') self.screen.current_view.set_value() if not self.screen.current_record.validate() \