Commit 75ac38de authored by Arnaud Fontaine's avatar Arnaud Fontaine

ERP5Workflow: Make sure that DCWorkflow patch are only applied with legacy Workflows.

parent 5e35e6d4
......@@ -37,13 +37,15 @@ class PortalTypeClassInteractor(Interactor):
and dynamic properties.
"""
def install(self):
from Products.DCWorkflow.Transitions import Transitions
self.on(Transitions.addTransition).doAfter(self.resetDynamic)
self.on(Transitions.deleteTransitions).doAfter(self.resetDynamic)
from Products.DCWorkflow.Transitions import TransitionDefinition
self.on(TransitionDefinition.setProperties).doAfter(self.resetDynamic)
from Products.DCWorkflow.Variables import Variables
self.on(Variables.setStateVar).doAfter(self.resetDynamic)
from Products.ERP5Type import WITH_LEGACY_WORKFLOW
if WITH_LEGACY_WORKFLOW:
from Products.DCWorkflow.Transitions import Transitions
self.on(Transitions.addTransition).doAfter(self.resetDynamic)
self.on(Transitions.deleteTransitions).doAfter(self.resetDynamic)
from Products.DCWorkflow.Transitions import TransitionDefinition
self.on(TransitionDefinition.setProperties).doAfter(self.resetDynamic)
from Products.DCWorkflow.Variables import Variables
self.on(Variables.setStateVar).doAfter(self.resetDynamic)
from Products.Localizer.Localizer import Localizer
self.on(Localizer.add_language).doAfter(self.resetDynamic)
......
......@@ -81,7 +81,9 @@ def initialize( context ):
'WorkflowException')
# Make sure InteactionWorkflow is visible in UI
import Products.ERP5.InteractionWorkflow
from Products.ERP5Type import WITH_LEGACY_WORKFLOW
if WITH_LEGACY_WORKFLOW:
import Products.ERP5.InteractionWorkflow
# backward compatibility names
XML = None
......
......@@ -38,7 +38,6 @@ if WITH_LEGACY_WORKFLOW:
from Products.ERP5Type.patches import BTreeFolder2
if WITH_LEGACY_WORKFLOW:
from Products.ERP5Type.patches import WorkflowTool
from Products.ERP5Type.patches import WorkflowTool
from Products.ERP5Type.patches import DynamicType
from Products.ERP5Type.patches import Expression
from Products.ERP5Type.patches import sqltest
......@@ -65,7 +64,8 @@ from Products.ERP5Type.patches import PythonScript
from Products.ERP5Type.patches import MailHost
from Products.ERP5Type.patches import http_server
from Products.ERP5Type.patches import memcache_client
from Products.ERP5Type.patches import StateChangeInfoPatch
if WITH_LEGACY_WORKFLOW:
from Products.ERP5Type.patches import StateChangeInfoPatch
from Products.ERP5Type.patches import transforms
from Products.ERP5Type.patches import OFSPdata
from Products.ERP5Type.patches import make_hidden_input
......@@ -101,5 +101,6 @@ from Products.ERP5Type.patches import urllib_opener
# These symbols are required for backward compatibility
from Products.ERP5Type.patches.PropertyManager import ERP5PropertyManager
from Products.ERP5Type.Core.Workflow import ValidationFailed
from Products.ERP5Type.patches.DCWorkflow import ERP5TransitionDefinition
if WITH_LEGACY_WORKFLOW:
from Products.ERP5Type.patches.DCWorkflow import ERP5TransitionDefinition
from Products.ERP5Type.patches.BTreeFolder2 import ERP5BTreeFolder2Base
......@@ -13,7 +13,8 @@
#
##############################################################################
# WITH_LEGACY_WORKFLOW
from Products.ERP5Type import WITH_LEGACY_WORKFLOW
assert WITH_LEGACY_WORKFLOW
## ERP5 Workflow: This must go before any Products.DCWorkflow imports as this
## patch createExprContext() from-imported in several of its modules
......
......@@ -26,6 +26,9 @@
#
##############################################################################
from Products.ERP5Type import WITH_LEGACY_WORKFLOW
assert WITH_LEGACY_WORKFLOW
from Products.DCWorkflow.Expression import StateChangeInfo
from Products.PythonScripts.Utility import allow_class
allow_class(StateChangeInfo)
......
......@@ -12,6 +12,9 @@
#
##############################################################################
from Products.ERP5Type import WITH_LEGACY_WORKFLOW
assert WITH_LEGACY_WORKFLOW
# State types patch for DCWorkflow
from Products.DCWorkflow.States import StateDefinition
from Products.ERP5Type.Globals import DTMLFile
......
......@@ -13,6 +13,9 @@
#
##############################################################################
from Products.ERP5Type import WITH_LEGACY_WORKFLOW
assert WITH_LEGACY_WORKFLOW
from zLOG import LOG, WARNING
from types import StringTypes
......
from Products.ERP5Type import WITH_LEGACY_WORKFLOW
assert WITH_LEGACY_WORKFLOW
from Products.DCWorkflow.Worklists import Worklists
from Products.DCWorkflow.Worklists import WorklistDefinition
from Products.ERP5Type.Permissions import ManagePortal
......
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