<?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.ZSQLCatalog.SQLCatalog import Query, NegatedQuery\n
movement = context\n
portal = movement.getPortalObject()\n
cleanup_service = portal.portal_preferences.getPreferredInstanceCleanupResource()\n
\n
if context.getSimulationState() == \'cancelled\':\n
  return\n
\n
instance = movement.getAggregateValue(portal_type="Software Instance")\n
# Search for other cleanup packing list (generated by UI double click for\n
# example)\n
newer_movement = portal.portal_catalog.getResultValue(\n
  portal_type="Sale Packing List Line",\n
  default_resource_uid=portal.restrictedTraverse(cleanup_service).getUid(),\n
  default_aggregate_uid=instance.getUid(),\n
  uid=NegatedQuery(Query(uid=movement.getUid())),\n
  simulation_state="confirmed",\n
  **{\'movement.start_date\': Query(**{\'movement.start_date\': movement.getStartDate(), \'range\': \'min\'})}\n
)\n
if (newer_movement is not None) and (newer_movement.getSimulationState() == \'confirmed\'):\n
  movement.getParentValue().cancel(comment="Another cleanup delivery found at %s" % newer_movement.getRelativeUrl())\n
</string> </value>
        </item>
        <item>
            <key> <string>_params</string> </key>
            <value> <string></string> </value>
        </item>
        <item>
            <key> <string>id</string> </key>
            <value> <string>SalePackingListLine_checkAndCancelCleanupPartition</string> </value>
        </item>
      </dictionary>
    </pickle>
  </record>
</ZopeData>
