From 3f068bc59881b9ceec87c1cf9b6000a6cb8c0bf7 Mon Sep 17 00:00:00 2001 From: Jaime Arroyo Date: Mon, 23 Sep 2019 13:12:18 +0200 Subject: [PATCH] [11.0][IMP] multi_step_wizard: Go Back --- multi_step_wizard/__manifest__.py | 4 +- multi_step_wizard/models/multi_step_wizard.py | 9 +++++ .../views/multi_step_wizard_views.xml | 37 ++++++++++--------- 3 files changed, 30 insertions(+), 20 deletions(-) diff --git a/multi_step_wizard/__manifest__.py b/multi_step_wizard/__manifest__.py index 7f8f1343..8188232a 100644 --- a/multi_step_wizard/__manifest__.py +++ b/multi_step_wizard/__manifest__.py @@ -4,8 +4,8 @@ 'version': '11.0.1.0.0', 'author': 'Camptocamp,Odoo Community Association (OCA)', 'license': 'AGPL-3', - 'depends': [], - 'website': 'https://github.com/camptocamp/connector-jira', + 'depends': ['base'], + 'website': 'https://github.com/OCA/connector-jira', 'data': [ 'views/multi_step_wizard_views.xml', ], diff --git a/multi_step_wizard/models/multi_step_wizard.py b/multi_step_wizard/models/multi_step_wizard.py index e6585fd7..e853223c 100644 --- a/multi_step_wizard/models/multi_step_wizard.py +++ b/multi_step_wizard/models/multi_step_wizard.py @@ -54,6 +54,15 @@ def open_next(self): state_method() return self._reopen_self() + def open_previous(self): + state_method = getattr(self, 'state_previous_%s' % (self.state,), None) + if state_method is None: + raise NotImplementedError( + 'No method defined for state %s' % (self.state,) + ) + state_method() + return self._reopen_self() + def _reopen_self(self): return { 'type': 'ir.actions.act_window', diff --git a/multi_step_wizard/views/multi_step_wizard_views.xml b/multi_step_wizard/views/multi_step_wizard_views.xml index 16e7fe1f..824113b2 100644 --- a/multi_step_wizard/views/multi_step_wizard_views.xml +++ b/multi_step_wizard/views/multi_step_wizard_views.xml @@ -1,23 +1,24 @@ - - multi.step.wizard.form - multi.step.wizard.mixin - -
- -
-
-
-
-
-
- -
-
+ + multi.step.wizard.form + multi.step.wizard.mixin + +
+ + + +
+