From 24e7236c7adc73dc2dfbcd2a0d7b436088f89a0f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Thu, 9 Jan 2014 18:44:16 +0100 Subject: [PATCH] Fix reload of screen at the end of wizard A wizard could be launch by a button defined on a children record. In this case, the ids to reload is not the ids from the wizard as they are from the children model but just the current record. issue3519 review2571002 --- tryton/gui/window/wizard.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/tryton/gui/window/wizard.py b/tryton/gui/window/wizard.py index a910de4997..869ec06f98 100644 --- a/tryton/gui/window/wizard.py +++ b/tryton/gui/window/wizard.py @@ -350,9 +350,13 @@ class WizardDialog(Wizard, NoModal): dialog = self.page if (hasattr(dialog, 'screen') and dialog.screen.current_record - and self.sensible_widget != main.window - and self.ids): - dialog.screen.reload(self.ids, written=True) + 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) def end(self): super(WizardDialog, self).end()