Commit e6d6ff8d authored by Łukasz Nowak's avatar Łukasz Nowak

Delay stopping of delivery.

During building Simulation Movement is modified (as delivery category is
updated) and thus reindexation is being registered.

While building not instance setup packing lists the simulation movement is
touched while delivery is in confirmed state, so vifib simulation movement
selection to be expanded works, as after later delivery being started or
stopped expand is called and movements are updated (eg. confirmed delivery
simulation movement has no children, but stopped has).

But instance setup is being immediately stopped, so simulation movement is
acquiring its simulation state from stopped packing lists, and alarm would
never select it for reexpanding.

By stopping delivery *after* movement is reindexed its simulation state is
desynchronised and alarm is capable to select such movement.
parent ab8d8c40
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>Script_magic</string> </key>
<value> <int>3</int> </value>
</item>
<item>
<key> <string>_bind_names</string> </key>
<value>
<object>
<klass>
<global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key> <string>_asgns</string> </key>
<value>
<dictionary>
<item>
<key> <string>name_container</string> </key>
<value> <string>container</string> </value>
</item>
<item>
<key> <string>name_context</string> </key>
<value> <string>context</string> </value>
</item>
<item>
<key> <string>name_m_self</string> </key>
<value> <string>script</string> </value>
</item>
<item>
<key> <string>name_subpath</string> </key>
<value> <string>traverse_subpath</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>_body</string> </key>
<value> <string>from Products.ERP5Type.Message import translateString\n
if context.getPortalType() != \'Sale Packing List\':\n
raise TypeError(\'%r is not Sale Packing List\' % context.getPath())\n
line = context.contentValues(portal_type=\'Sale Packing List Line\')[0]\n
\n
portal = context.getPortalObject()\n
if line.getResource() != portal.portal_preferences.getPreferredInstanceSetupResource():\n
raise TypeError(\'%r is not Instance Setup Sale Packing List\' % context.getPath())\n
\n
comment = translateString(\'Automatic transition on setup delivery.\')\n
if portal.portal_workflow.isTransitionPossible(context, \'start\'):\n
context.start(comment=comment)\n
if portal.portal_workflow.isTransitionPossible(context, \'stop\'):\n
context.stop(comment=comment)\n
</string> </value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>SalePackingList_stopInstanceSetup</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
...@@ -53,7 +53,6 @@ ...@@ -53,7 +53,6 @@
<value> <string>if related_simulation_movement_path_list is None:\n <value> <string>if related_simulation_movement_path_list is None:\n
raise RuntimeError, \'related_simulation_movement_path_list is missing. Update ERP5 Product.\'\n raise RuntimeError, \'related_simulation_movement_path_list is missing. Update ERP5 Product.\'\n
\n \n
from Products.ERP5Type.Message import translateString\n
packing_list = context\n packing_list = context\n
\n \n
try:\n try:\n
...@@ -67,12 +66,10 @@ packing_list.Delivery_confirm()\n ...@@ -67,12 +66,10 @@ packing_list.Delivery_confirm()\n
\n \n
line = packing_list.contentValues(portal_type=\'Sale Packing List Line\')[0]\n line = packing_list.contentValues(portal_type=\'Sale Packing List Line\')[0]\n
portal = packing_list.getPortalObject()\n portal = packing_list.getPortalObject()\n
comment = translateString(\'Automatic transition on setup delivery.\')\n \n
if line.getResource() == portal.portal_preferences.getPreferredInstanceSetupResource():\n if line.getResource() == portal.portal_preferences.getPreferredInstanceSetupResource():\n
if portal.portal_workflow.isTransitionPossible(packing_list, \'start\'):\n packing_list.activate(after_path_and_method_id=(related_simulation_movement_path_list,\n
packing_list.start(comment=comment)\n (\'immediateReindexObject\', \'recursiveImmediateReindexObject\'))).SalePackingList_stopInstanceSetup()\n
if portal.portal_workflow.isTransitionPossible(packing_list, \'stop\'):\n
packing_list.stop(comment=comment)\n
\n \n
# First set the packing_list in the building state\n # First set the packing_list in the building state\n
packing_list.startBuilding()\n packing_list.startBuilding()\n
......
447 448
\ No newline at end of file \ 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