Commit ee15dfe2 authored by Julien Muchembled's avatar Julien Muchembled

erp5_core: small optimization of Base_getWorkflowHistorySectionList

- do not copy the result of Base_getWorkflowHistory, and only iterate on keys
- call getPhysicalPath only once
- get workflow tool only once, and without relying on acquisition
parent 90084370
...@@ -51,24 +51,20 @@ ...@@ -51,24 +51,20 @@
<item> <item>
<key> <string>_body</string> </key> <key> <string>_body</string> </key>
<value> <string>from Products.ERP5Form.Report import ReportSection\n <value> <string>from Products.ERP5Form.Report import ReportSection\n
result = []\n path = context.getPhysicalPath()\n
\n portal_workflow = context.getPortalObject().portal_workflow\n
history_dict = context.Base_getWorkflowHistory()\n return [\n
for workflow_id, workflow_history in history_dict.items():\n ReportSection(\n
workflow_title = context.portal_workflow[workflow_id].title or workflow_id\n form_id="Base_viewWorkflowHistory",\n
result.append(\n level=1,\n
ReportSection(\n listbox_display_mode="FlatListMode",\n
path=context.getPhysicalPath(),\n path=path,\n
level=1,\n selection_params={\n
form_id=\'Base_viewWorkflowHistory\',\n "workflow_id": workflow_id,\n
selection_params={\'workflow_id\': workflow_id,\n "workflow_title": portal_workflow[workflow_id].title or workflow_id},\n
\'workflow_title\' : workflow_title},\n temporary_selection=False)\n
listbox_display_mode=\'FlatListMode\',\n for workflow_id in context.Base_getWorkflowHistory()\n
temporary_selection=False,\n ]\n
)\n
)\n
\n
return result\n
</string> </value> </string> </value>
</item> </item>
<item> <item>
......
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