Commit f30400f2 authored by wenjie.zheng's avatar wenjie.zheng Committed by Sebastien Robin

ERP5WorkflowTool.py: add bootstrap function to migrate the workflow tool...

ERP5WorkflowTool.py: add bootstrap function to migrate the workflow tool conditionally-autoomatically.
parent 1094fea4
...@@ -118,6 +118,16 @@ class ERP5WorkflowTool(BaseTool, OriginalWorkflowTool): ...@@ -118,6 +118,16 @@ class ERP5WorkflowTool(BaseTool, OriginalWorkflowTool):
PropertySheet.DublinCore, PropertySheet.DublinCore,
) )
def _isBootstrapRequired(self):
# migrate after ERP5Tool installed (portal_rules is the first item of setupLastTools
# in ERP5Site.py);
if self.getPortalObject()._getOb('portal_rules', None) is not None:
return True
return False
def _bootstrap(self):
self.getPortalObject().migrateToPortalWorkflowClass()
def _jumpToStateFor(self, ob, state_id, wf_id=None, *args, **kw): def _jumpToStateFor(self, ob, state_id, wf_id=None, *args, **kw):
"""Inspired from doActionFor. """Inspired from doActionFor.
This is public method to allow passing meta transition (Jump form This is public method to allow passing meta transition (Jump form
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment