From a0f4d5df6273074ceabaf1f16b702baea747bae1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20=C3=89vrard?= Date: Tue, 12 Apr 2016 08:23:13 +0200 Subject: [PATCH] Correctly get action_id when instanciating a Wizard In case a Wizard is instanciated with an action (eg. when being called from a StateAction from another wizard) the data structure received is a dictionary and not an instance of Action. issue5465 review25031002 --- proteus/__init__.py | 2 +- proteus/tests/test_wizard.py | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/proteus/__init__.py b/proteus/__init__.py index 56b8c21f51..d63769e803 100644 --- a/proteus/__init__.py +++ b/proteus/__init__.py @@ -1076,7 +1076,7 @@ class Wizard(object): ctx['active_ids'] = None ctx['active_model'] = None if self.action: - ctx['action_id'] = self.action.id + ctx['action_id'] = self.action['id'] else: ctx['action_id'] = None diff --git a/proteus/tests/test_wizard.py b/proteus/tests/test_wizard.py index d2c384f371..7edf20044d 100644 --- a/proteus/tests/test_wizard.py +++ b/proteus/tests/test_wizard.py @@ -46,3 +46,8 @@ class TestWizard(ProteusTestCase): self.assertEqual(len(print_model_graph.actions), 0) print_model_graph.execute('update') self.assertEqual(len(print_model_graph.actions), 1) + + def test_configuration_wizard(self): + config_wizard = Wizard('ir.module.config_wizard') + config_wizard.execute('action') + self.assertTrue(config_wizard.actions)