From a320fbc2b2d1c4ff6f17846e243020231f50ad3b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Mon, 9 Jun 2014 18:01:59 +0200 Subject: [PATCH] Execute client action also for wizard run from menu issue3964 review7341002 --- tryton/gui/window/wizard.py | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/tryton/gui/window/wizard.py b/tryton/gui/window/wizard.py index 42d625e407..55b34f5689 100644 --- a/tryton/gui/window/wizard.py +++ b/tryton/gui/window/wizard.py @@ -341,17 +341,20 @@ class WizardDialog(Wizard, NoModal): dialog = self.page.dialogs[-1] else: dialog = self.page - if (getattr(dialog, 'screen', None) - and dialog.screen.current_record - and self.sensible_widget != main.window): - if dialog.screen.model_name == self.model: - ids = self.ids - else: - # Wizard run from a children record so reload parent record - ids = [dialog.screen.current_record.id] - dialog.screen.reload(ids, written=True) + screen = getattr(dialog, 'screen', None) + if self.sensible_widget == main.window: + screen = main.menu_screen + if screen: + if (screen.current_record + and self.sensible_widget != main.window): + if screen.model_name == self.model: + ids = self.ids + else: + # Wizard run from a children record so reload parent record + ids = [screen.current_record.id] + screen.reload(ids, written=True) if action: - dialog.screen.client_action(action) + screen.client_action(action) def end(self, callback=None): def end_callback(action):