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
This commit is contained in:
Cédric Krier committed 2014-01-09 18:44:16 +01:00
1 parent dcfb0c178d
commit 24e7236c7a
1 file changed
+7 -3
+7 -3
View File
@@ -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()