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

WorkflowTool.py: patch the ImmutableId to allow migrating CMF Workflow Tool to ERP5 Workflow Tool.

parent b25ce0d2
......@@ -28,7 +28,7 @@ from Products.DCWorkflow.Transitions import TRIGGER_WORKFLOW_METHOD, TransitionD
from Products.CMFCore.utils import getToolByName
from Products.ZSQLCatalog.SQLCatalog import SimpleQuery, AutoQuery, ComplexQuery, NegatedQuery
from Products.CMFCore.utils import _getAuthenticatedUser
from Products.CMFCore.utils import _getAuthenticatedUser, ImmutableId
from Products.ERP5Type.Cache import CachingMethod
from sets import ImmutableSet
from Acquisition import aq_base
......@@ -65,6 +65,18 @@ class ExclusionTuple(tuple):
"""
pass
def ImmutableId_setId(self):
""" patch which allows modifying the Id of portal_workflow
for the sake of workflow tool migration.
"""
if self.getId() in ['portal_workflow', 'portal_workflow_new']:
pass
else:
if id != self.getId():
raise ValueError('Changing the id of this object is forbidden: %s'
% self.getId())
ImmutableId._setId = ImmutableId_setId
def getValidCriterionDict(worklist_match_dict, sql_catalog,
workflow_worklist_key):
valid_criterion_dict = {}
......
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