Commit 670e7553 authored by Kazuhiko Shiozaki's avatar Kazuhiko Shiozaki

workflow: import InteractionWorkflowDefinition only if WITH_LEGACY_WORKFLOW is True.

parent 8d5a3ce4
...@@ -3534,7 +3534,11 @@ class Base( ...@@ -3534,7 +3534,11 @@ class Base(
# Use meta transition to jump from one state to another # Use meta transition to jump from one state to another
# without existing transitions. # without existing transitions.
from Products.ERP5Type import WITH_LEGACY_WORKFLOW
if WITH_LEGACY_WORKFLOW:
from Products.ERP5.InteractionWorkflow import InteractionWorkflowDefinition from Products.ERP5.InteractionWorkflow import InteractionWorkflowDefinition
else:
InteractionWorkflowDefinition = None.__class__
from Products.ERP5Type.Core.InteractionWorkflow import InteractionWorkflow from Products.ERP5Type.Core.InteractionWorkflow import InteractionWorkflow
portal = self.getPortalObject() portal = self.getPortalObject()
workflow_tool = portal.portal_workflow workflow_tool = portal.portal_workflow
......
...@@ -98,7 +98,10 @@ class WorkflowTool(BaseTool, OriginalWorkflowTool): ...@@ -98,7 +98,10 @@ class WorkflowTool(BaseTool, OriginalWorkflowTool):
This is public method to allow passing meta transition (Jump form This is public method to allow passing meta transition (Jump form
any state to another in same workflow) any state to another in same workflow)
""" """
if WITH_LEGACY_WORKFLOW:
from Products.ERP5.InteractionWorkflow import InteractionWorkflowDefinition from Products.ERP5.InteractionWorkflow import InteractionWorkflowDefinition
else:
InteractionWorkflowDefinition = None.__class__
from Products.ERP5Type.Core.InteractionWorkflow import InteractionWorkflow from Products.ERP5Type.Core.InteractionWorkflow import InteractionWorkflow
workflow_list = self.getWorkflowValueListFor(ob.getPortalType()) workflow_list = self.getWorkflowValueListFor(ob.getPortalType())
if wf_id is None: if wf_id is None:
...@@ -124,7 +127,10 @@ class WorkflowTool(BaseTool, OriginalWorkflowTool): ...@@ -124,7 +127,10 @@ class WorkflowTool(BaseTool, OriginalWorkflowTool):
"""Test if given state_id is available for ob """Test if given state_id is available for ob
in at least one associated workflow in at least one associated workflow
""" """
if WITH_LEGACY_WORKFLOW:
from Products.ERP5.InteractionWorkflow import InteractionWorkflowDefinition from Products.ERP5.InteractionWorkflow import InteractionWorkflowDefinition
else:
InteractionWorkflowDefinition = None.__class__
from Products.ERP5Type.Core.InteractionWorkflow import InteractionWorkflow from Products.ERP5Type.Core.InteractionWorkflow import InteractionWorkflow
for workflow in (wf_id and (self[wf_id],) or self.getWorkflowValueListFor(ob.getPortalType())): for workflow in (wf_id and (self[wf_id],) or self.getWorkflowValueListFor(ob.getPortalType())):
if not isinstance(workflow, (InteractionWorkflowDefinition, if not isinstance(workflow, (InteractionWorkflowDefinition,
......
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