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

Base.py: remove prefix to show good contents in workflow history.

parent 0938de15
......@@ -203,9 +203,9 @@ class ERP5WorkflowMethod(Method):
### zwj: Execute method
for wf_id, transition_list in valid_transition_item_list:
try:
for tr in transition_list:
method = wf_module._getOb(wf_id)._getOb(tr)
LOG(" 208 executing method '%s' of workflow '%s'"%(tr, wf_id), WARNING, " in Base.py")
for tr_id in transition_list:
method = wf_module._getOb(wf_id)._getOb(tr_id)
LOG(" 208 executing method '%s' of workflow '%s'"%(tr_id, wf_id), WARNING, " in Base.py")
method.execute(instance)
except ObjectDeleted:
raise ObjectDeleted(result)
......@@ -679,7 +679,7 @@ def initializePortalTypeERP5WorkflowMethod(ptype_klass, portal_workflow):
transition_id_list = [] #ERP5Workflow.objectIds(portal_type='Transition')
transition_list = ERP5Workflow.objectValues(portal_type='Transition')
for tr in transition_list:
transition_id_list.append('_'.join(tr.getId().split('_')[:-1]))### getRef, this id list is actually a reference list
transition_id_list.append('_'.join(tr.getId().split('_')[1:]))### getRef, this id list is actually a reference list
LOG("686 transition_id_list = '%s'"%transition_id_list, WARNING, " in Base.py")
elif workflow_type == 'DCWorkflowDefinition':
LOG("688 Generating methods of DCWorkflow '%s'"%ERP5Workflow_id, WARNING, " in Base.py")
......@@ -696,7 +696,7 @@ def initializePortalTypeERP5WorkflowMethod(ptype_klass, portal_workflow):
transition_id_list = []
transition_list = ERP5Workflow.objectValues(portal_type='Interaction')
for tr in transition_list:
transition_id_list.append('_'.join(tr.getId().split('_')[:-1])) # remove suffinx
transition_id_list.append('_'.join(tr.getId().split('_')[1:])) # remove suffinx
LOG("703 transition_id_list = '%s'"%transition_id_list, WARNING, ' in Base.py')
elif workflow_type == 'InteractionWorkflowDefinition':
LOG("705 Generating methods of DC Interaction Workflow '%s'"%ERP5Workflow_id, WARNING, ' in Base.py')
......@@ -727,7 +727,7 @@ def initializePortalTypeERP5WorkflowMethod(ptype_klass, portal_workflow):
transition_id_set, trigger_dict = v
for tr_id, tdef in trigger_dict.iteritems():
LOG("733 processing transition '%s' of '%s'"%(tr_id,ERP5Workflow_id), WARNING, "in Base.py")
method_id = convertToMixedCase('_'.join(tr_id.split('_')[:-1]))
method_id = convertToMixedCase('_'.join(tr_id.split('_')[1:]))
LOG(" 731 register transition '%s' as method '%s'"%(tr_id, method_id), WARNING, " in Base.py")
try:
method = getattr(ptype_klass, method_id)
......@@ -3090,7 +3090,7 @@ class Base( CopyContainer,
for workflow_id in self.getTypeInfo().getTypeERP5WorkflowList():
workflow = self.getPortalObject().portal_workflow._getOb(workflow_id)
if workflow.getPortalType() == 'Workflow':
result += [('_'.join(workflow_id.split('_')[:-1]), workflow._getWorkflowStateOf(self, id_only=1))]
result += [('_'.join(workflow_id.split('_')[1:]), workflow._getWorkflowStateOf(self, id_only=1))]
LOG(" 3093 Workflow History result is '%s'"%result, WARNING, " in Base.py")
return result
......
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