Commit 07da2461 authored by Kazuhiko Shiozaki's avatar Kazuhiko Shiozaki

use recurseCallMethod instead of ERP5Site_checkDataWithScript that is deprecated and inefficient.

parent a12fa2c2
......@@ -62,5 +62,5 @@ def migrateEventWorkflowHistory(self):
return
workflow_tool = portal.portal_workflow
workflow_tool._jumpToStateFor(self, new_state)
return ['Event workflow migration on %s : %s -> %s' % (
self.getPath(), current_state, new_state)]
return 'Event workflow migration on %s : %s -> %s' % (
self.getPath(), current_state, new_state)
......@@ -8,7 +8,7 @@
<dictionary>
<item>
<key> <string>active_sense_method_id</string> </key>
<value> <string>ERP5Site_migrateEventWorkflowHistory</string> </value>
<value> <string>EventModule_migrateEventWorkflowHistory</string> </value>
</item>
<item>
<key> <string>description</string> </key>
......
......@@ -50,12 +50,13 @@
</item>
<item>
<key> <string>_body</string> </key>
<value> <string>active_process = context.getPortalObject().portal_activities.newActiveProcess()\n
context.getPortalObject().ERP5Site_checkDataWithScript("Event_migrateEventWorkflowHistory",\n
tag="migrate",\n
relative_url="event_module",\n
full=1,\n
active_process=active_process.getPath())\n
<value> <string>portal = context.getPortalObject()\n
active_process = portal.portal_activities.newActiveProcess()\n
portal.event_module.recurseCallMethod(\n
\'Event_migrateEventWorkflowHistory\',\n
active_process=active_process,\n
min_depth=1,\n
max_depth=1)\n
print "Migration started with process id: %s" %active_process.getPath()\n
return printed\n
</string> </value>
......@@ -66,7 +67,7 @@ return printed\n
</item>
<item>
<key> <string>id</string> </key>
<value> <string>ERP5Site_migrateEventWorkflowHistory</string> </value>
<value> <string>EventModule_migrateEventWorkflowHistory</string> </value>
</item>
</dictionary>
</pickle>
......
581
\ No newline at end of file
582
\ 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