Commit 3fbbe559 authored by wenjie.zheng's avatar wenjie.zheng

erp5_core: Folder_generateWorkflowReport compatibility modification.

parent 01225d6d
......@@ -68,24 +68,28 @@ for portal_type in content_type_list:\n
workflow_list = workflow_tool.getWorkflowsFor(portal_type_id)\n
# Retrieve the workflows by portal_type\n
for workflow in workflow_list:\n
workflow_title = workflow.title\n
workflow_state_dict = workflow.getStateValueList()\n
# not \'edit_workflow\' because state variable is not in catalog\n
if getattr(workflow, \'states\', None) is not None and \\\n
if workflow_state_dict != {} and\\\n
workflow.getId() != \'edit_workflow\':\n
#retrieve state_var to search in the catalog the states use by the\n
#workflow\n
state_var = workflow.state_var\n
state_var = workflow.getStateVariable()\n
if state_var is None:\n
state_var = \'state\'\n
result_list = context.Base_zCountByWorkflowState(portal_type=portal_type_id,\n
state_name=state_var)\n
if not ((len(result_list) == 1) and (result_list[0][0] is None)):\n
for result in result_list:\n
portal_type_dict = result_dict.get(portal_type_id,{})\n
workflow_dict = portal_type_dict.get(workflow.title,{})\n
workflow_dict = portal_type_dict.get(workflow_title,{})\n
workflow_dict.update({result[0]:result[1]})\n
portal_type_dict.update({workflow.title:workflow_dict})\n
portal_type_dict.update({workflow_title:workflow_dict})\n
result_dict.update({portal_type_id:portal_type_dict})\n
# store the title states for the translation\n
if not translate_state_dict.has_key(result[0]):\n
state_title = getattr(workflow.states, result[0]).title_or_id()\n
state_title = workflow_state_dict.get(result[0]).title_or_id()\n
translate_state_dict[result[0]] = state_title\n
\n
#Display the result\n
......
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