Commit 20ee9b58 authored by iv's avatar iv

ERP5Workflow: some refactoring on dc_workflow_asERP5Object

parent c33ac428
...@@ -86,7 +86,7 @@ for workflow in selected_workflow_list:\n ...@@ -86,7 +86,7 @@ for workflow in selected_workflow_list:\n
url_quote(\'workflow(s) is already exist.\')))\n url_quote(\'workflow(s) is already exist.\')))\n
\n \n
# conversion and reassignment\n # conversion and reassignment\n
new_workflow = context.dc_workflow_asERP5Object(context, workflow, temp=0)\n new_workflow = context.dc_workflow_asERP5Object(workflow, is_temporary=False)\n
context.reassignWorkflow(new_workflow.getId())\n context.reassignWorkflow(new_workflow.getId())\n
selected_workflow_id_list.append(new_workflow.getId())\n selected_workflow_id_list.append(new_workflow.getId())\n
\n \n
......
...@@ -1014,14 +1014,14 @@ class ERP5TypeCommandLineTestCase(ERP5TypeTestCaseMixin): ...@@ -1014,14 +1014,14 @@ class ERP5TypeCommandLineTestCase(ERP5TypeTestCaseMixin):
workflow = workflow_tool._getOb(workflow_id) workflow = workflow_tool._getOb(workflow_id)
if workflow.getPortalType() not in ['Workflow', 'Interaction Workflow', 'Configuration Workflow']: if workflow.getPortalType() not in ['Workflow', 'Interaction Workflow', 'Configuration Workflow']:
LOG("### workflow id" , 0, workflow_id) LOG("### workflow id" , 0, workflow_id)
new_workflow = workflow_tool.dc_workflow_asERP5Object(workflow_tool, workflow, temp=0) new_workflow = workflow_tool.dc_workflow_asERP5Object(workflow, is_temporary=False)
workflow_tool.reassignWorkflow(workflow_id) workflow_tool.reassignWorkflow(workflow_id)
self.commit() self.commit()
LOG("### reassigned" , 0, workflow_id) LOG("### reassigned" , 0, workflow_id)
# force convert edit_workflow: Why have to load edit_workflow this way? # force convert edit_workflow: Why have to load edit_workflow this way?
edit_workflow = workflow_tool._getOb('edit_workflow', None) edit_workflow = workflow_tool._getOb('edit_workflow', None)
if edit_workflow is not None: if edit_workflow is not None:
new_workflow = workflow_tool.dc_workflow_asERP5Object(workflow_tool, edit_workflow, temp=0) new_workflow = workflow_tool.dc_workflow_asERP5Object(edit_workflow, is_temporary=False)
workflow_tool.reassignWorkflow('edit_workflow') workflow_tool.reassignWorkflow('edit_workflow')
LOG("### edit workflow" , 0, "after reassignment") LOG("### edit workflow" , 0, "after reassignment")
self.commit() self.commit()
......
This diff is collapsed.
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