Commit 4ff8a0e0 authored by Łukasz Nowak's avatar Łukasz Nowak

Automatically put setup deliveries in stopped state.

parent 79da7357
......@@ -54,7 +54,6 @@
raise RuntimeError, \'related_simulation_movement_path_list is missing. Update ERP5 Product.\'\n
\n
from Products.ERP5Type.Message import translateString\n
\n
packing_list = context\n
\n
try:\n
......@@ -66,6 +65,15 @@ except AttributeError:\n
# Then, modify state\n
packing_list.Delivery_confirm()\n
\n
line = packing_list.contentValues(portal_type=\'Sale Packing List Line\')[0]\n
portal = packing_list.getPortalObject()\n
comment = translateString(\'Automatic transition on setup delivery.\')\n
if line.getResource() == portal.portal_preferences.getPreferredInstanceSetupResource():\n
if portal.portal_workflow.isTransitionPossible(packing_list, \'start\'):\n
packing_list.start(comment=comment)\n
if portal.portal_workflow.isTransitionPossible(packing_list, \'stop\'):\n
packing_list.stop(comment=comment)\n
\n
# First set the packing_list in the building state\n
packing_list.startBuilding()\n
</string> </value>
......
443
\ No newline at end of file
444
\ 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