Commit 16194e30 authored by iv's avatar iv

ERP5Workflow: use restrictedTraverse in conversion script

and don't update translation table if in case of temporary object
parent 79faf8b3
......@@ -10,7 +10,7 @@ if batch_mode == False and workflow_id_list is None:
if workflow_list:
for workflow in workflow_list:
if workflow.get('listbox_selected'):
selected_workflow_list.append(context.unrestrictedTraverse(workflow.get('listbox_key')))
selected_workflow_list.append(context.restrictedTraverse(workflow.get('listbox_key')))
if len(selected_workflow_list) == 0:
return context.REQUEST.RESPONSE.redirect(
......
......@@ -587,8 +587,9 @@ class WorkflowTool(BaseTool, OriginalWorkflowTool):
self._finalizeWorkflowConversion(dc_workflow)
# override temporary id:
workflow.setId(workflow.default_reference)
# update translation so that the catalog contains translated states, ...
self.getPortalObject().ERP5Site_updateTranslationTable()
if not is_temporary:
# update translation so that the catalog contains translated states, ...
self.getPortalObject().ERP5Site_updateTranslationTable()
return workflow
def reassignWorkflow(self, workflow_id):
......
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