Commit 02f4b0ac authored by Jean-Paul Smets's avatar Jean-Paul Smets

again small fix for convertToMixedCased on wf methods in aq_dynamic


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@2102 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 89c906ed
...@@ -191,10 +191,10 @@ def initializePortalTypeDynamicProperties(self, klass, ptype, recursive=0): ...@@ -191,10 +191,10 @@ def initializePortalTypeDynamicProperties(self, klass, ptype, recursive=0):
if tdef.trigger_type == TRIGGER_WORKFLOW_METHOD: if tdef.trigger_type == TRIGGER_WORKFLOW_METHOD:
method_id = convertToMixedCase(tr_id) method_id = convertToMixedCase(tr_id)
if not hasattr(klass, method_id): if not hasattr(klass, method_id):
method = WorkflowMethod(klass._doNothing, method_id) method = WorkflowMethod(klass._doNothing, tr_id)
setattr(prop_holder, method_id, method) # Attach to portal_type setattr(prop_holder, method_id, method) # Attach to portal_type
prop_holder.security.declareProtected( Permissions.AccessContentsInformation, method_id ) prop_holder.security.declareProtected( Permissions.AccessContentsInformation, method_id )
LOG('in aq_portal_type %s' % id, 0, "added transition method %s" % method_id) #LOG('in aq_portal_type %s' % id, 0, "added transition method %s" % method_id)
else: else:
# Wrap method into WorkflowMethod is needed # Wrap method into WorkflowMethod is needed
method = getattr(klass, method_id) method = getattr(klass, method_id)
...@@ -208,7 +208,7 @@ def initializePortalTypeDynamicProperties(self, klass, ptype, recursive=0): ...@@ -208,7 +208,7 @@ def initializePortalTypeDynamicProperties(self, klass, ptype, recursive=0):
for imethod_id in tdef.method_id: for imethod_id in tdef.method_id:
method_id = convertToMixedCase(imethod_id) method_id = convertToMixedCase(imethod_id)
if not hasattr(klass, method_id): if not hasattr(klass, method_id):
method = WorkflowMethod(klass._doNothing, method_id) method = WorkflowMethod(klass._doNothing, imethod_id)
setattr(prop_holder, method_id, method) # Attach to portal_type setattr(prop_holder, method_id, method) # Attach to portal_type
prop_holder.security.declareProtected( Permissions.AccessContentsInformation, method_id ) prop_holder.security.declareProtected( Permissions.AccessContentsInformation, method_id )
#LOG('in aq_portal_type %s' % id, 0, "added interaction method %s" % method_id) #LOG('in aq_portal_type %s' % id, 0, "added interaction method %s" % method_id)
......
...@@ -505,6 +505,7 @@ from Products.DCWorkflow.DCWorkflow import DCWorkflowDefinition, StateChangeInfo ...@@ -505,6 +505,7 @@ from Products.DCWorkflow.DCWorkflow import DCWorkflowDefinition, StateChangeInfo
from Products.DCWorkflow import DCWorkflow from Products.DCWorkflow import DCWorkflow
from Products.DCWorkflow.Transitions import TRIGGER_WORKFLOW_METHOD from Products.DCWorkflow.Transitions import TRIGGER_WORKFLOW_METHOD
from Products.CMFCore.WorkflowCore import WorkflowException from Products.CMFCore.WorkflowCore import WorkflowException
from Products.ERP5Type.Utils import convertToMixedCase
class ValidationFailed(Exception): class ValidationFailed(Exception):
"""Transition can not be executed because data is not in consistent state""" """Transition can not be executed because data is not in consistent state"""
......
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