<?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>assert(context.getPortalType() == \'Sale Order Line\')\n
assert(context.getSimulationState() == \'confirmed\')\n
packing_list = context.getParentValue().getCausalityRelatedValue(portal_type=\'Sale Packing List\')\n
assert(packing_list is not None)\n
packing_list_line_list = packing_list.getMovementList()\n
assert(len(packing_list_line_list) == 1)\n
packing_list_line = packing_list_line_list[0]\n
simulation_movement = context.getDeliveryRelatedValue(portal_type=\'Simulation Movement\')\n
assert(simulation_movement is not None)\n
applied_rule_list = simulation_movement.searchFolder(portal_type=\'Applied Rule\')\n
assert(len(applied_rule_list)) == 1\n
applied_rule = applied_rule_list[0]\n
assert(applied_rule.getSpecialiseValue().getReference() == \'default_delivering_rule\')\n
delivery_simulation_list = applied_rule.searchFolder()\n
assert(len(delivery_simulation_list) == 1)\n
delivery_simulation = delivery_simulation_list[0]\n
packing_list_line_url = packing_list_line.getRelativeUrl()\n
if delivery_simulation.getDelivery() == packing_list_line_url:\n
  # already setup, nothing to do\n
  return\n
assert(delivery_simulation.getDelivery() is None)\n
delivery_simulation.setDelivery(packing_list_line_url)\n
</string> </value>
        </item>
        <item>
            <key> <string>_params</string> </key>
            <value> <string></string> </value>
        </item>
        <item>
            <key> <string>id</string> </key>
            <value> <string>SaleOrderLine_linkSimulationMovementToPackingListLine</string> </value>
        </item>
      </dictionary>
    </pickle>
  </record>
</ZopeData>
