Commit 34cb03dc authored by Rafael Monnerat's avatar Rafael Monnerat

Ignore start transition when Sale Packing List is already started

When some Slave Instance allocated on some computer partition, it
trigger the "start" broadcast and sometimes some Sale Packing Lists are
already started, long ago.
parent dc6bfffa
......@@ -50,11 +50,14 @@
</item>
<item>
<key> <string>_body</string> </key>
<value> <string>isTransitionPossible = context.portal_workflow.isTransitionPossible\n
<value> <string>from Products.ERP5Type.Log import log\n
packing_list_line = context.SlaveInstance_getInstanceHostingPackingListLine(state_change)\n
packing_list = packing_list_line.getParentValue()\n
if isTransitionPossible(packing_list, "start"):\n
packing_list.start()\n
if packing_list_line.getSimulationState() != "started":\n
packing_list_line.getParentValue().start()\n
else:\n
slave_instance = state_change["object"].getRelativeUrl()\n
log("Unable to start sale Packing List %s for Software Instance %s" % \\\n
(packing_list_line.getRelativeUrl(), slave_instance))\n
</string> </value>
</item>
<item>
......
......@@ -50,9 +50,14 @@
</item>
<item>
<key> <string>_body</string> </key>
<value> <string>packing_list_line = context.SoftwareInstance_getInstanceHostingPackingListLine(state_change)\n
packing_list = packing_list_line.getParentValue()\n
packing_list.start()\n
<value> <string>from Products.ERP5Type.Log import log\n
packing_list_line = context.SoftwareInstance_getInstanceHostingPackingListLine(state_change)\n
if packing_list_line.getSimulationState() != "started":\n
packing_list_line.getParentValue().start()\n
else:\n
software_instance = state_change["object"].getRelativeUrl()\n
log("Unable to start sale Packing List %s for Software Instance %s" % \\\n
(packing_list_line.getRelativeUrl(), software_instance))\n
</string> </value>
</item>
<item>
......
262
\ No newline at end of file
263
\ 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