Commit c6a93d4e authored by wenjie.zheng's avatar wenjie.zheng

Transition.py: WorkflowHistoryList generation now is compatibale with...

Transition.py: WorkflowHistoryList generation now is compatibale with ERP5Workflow value, although, same values registered is not correct.
parent a3624ea3
...@@ -190,7 +190,7 @@ class Transition(XMLObject): ...@@ -190,7 +190,7 @@ class Transition(XMLObject):
document, workflow, former_status, self, old_sdef, new_sdef, kwargs) document, workflow, former_status, self, old_sdef, new_sdef, kwargs)
# put the error message in the workflow history # put the error message in the workflow history
sci.setWorkflowVariable(error_message=before_script_error_message) sci.setWorkflowVariable(error_message=before_script_error_message)
status_dict['error_message'] = before_script_error_message #status_dict['error_message'] = before_script_error_message
if validation_exc : if validation_exc :
# reraise validation failed exception # reraise validation failed exception
raise validation_exc, None, validation_exc_traceback raise validation_exc, None, validation_exc_traceback
...@@ -207,7 +207,7 @@ class Transition(XMLObject): ...@@ -207,7 +207,7 @@ class Transition(XMLObject):
self.getParent().updateRoleMappingsFor(document) self.getParent().updateRoleMappingsFor(document)
status_dict['undo'] = 0 status_dict['undo'] = 0
status_dict['action'] = self.getId() #status_dict['action'] = self.getId()
# Modify workflow history # Modify workflow history
status_dict[state_bc_id] = new_state status_dict[state_bc_id] = new_state
...@@ -225,12 +225,12 @@ class Transition(XMLObject): ...@@ -225,12 +225,12 @@ class Transition(XMLObject):
if tdef_exprs is None: if tdef_exprs is None:
tdef_exprs = {} tdef_exprs = {}
#status = {} ### zwj: here replace by status_dict #status = {} ### zwj: here replaced by status_dict
#for id, vdef in workflow.objectValues(portal_type='Variable').items(): #for id, vdef in workflow.objectValues(portal_type='Variable').items():
for vdef in workflow.objectValues(portal_type='Variable'): for vdef in workflow.objectValues(portal_type='Variable'):
id = vdef.getId() id = vdef.getId()
if not vdef.for_status: if vdef.for_status == 0:
continue continue
expr = None expr = None
if id in state_values: if id in state_values:
...@@ -342,6 +342,8 @@ class Transition(XMLObject): ...@@ -342,6 +342,8 @@ class Transition(XMLObject):
ob.workflow_history = PersistentMapping() ob.workflow_history = PersistentMapping()
ob.workflow_history[wf_id] = wfh ob.workflow_history[wf_id] = wfh
wfh.append(status) wfh.append(status)
"""
if not has_history: if not has_history:
ob.workflow_history = PersistentMapping() ob.workflow_history = PersistentMapping()
ob.workflow_history[wf_id] = tuple(wfh) ob.workflow_history[wf_id] = tuple(wfh)
"""
\ No newline at end of file
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