From c8112db48b8ff0769ce07346ef804ea1119271f0 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 (transplanted from 6f657eeefffcc5a74be70e7cc8868fc7293d3c44) --- 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 e366e3cd20..19a5f6c55f 100644 --- a/tryton/gui/window/wizard.py +++ b/tryton/gui/window/wizard.py @@ -349,9 +349,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()