<?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>computer = context.Agent_getComputerDocumentFromReference(computer_reference)\n
software_release = context.Agent_getSoftwareReleaseDocumentFromReference(software_release_reference)\n
portal = context.getPortalObject()\n
software_release_url = software_release.getUrlString()\n
from Products.ZSQLCatalog.SQLCatalog import Query, ComplexQuery\n
service_relative_url = portal.portal_preferences.getPreferredSoftwareCleanupResource()\n
service = portal.restrictedTraverse(service_relative_url)\n
service_uid = service.getUid()\n
state_list = []\n
state_list.extend(portal.getPortalReservedInventoryStateList())\n
state_list.extend(portal.getPortalTransitInventoryStateList())\n
packing_list_line = portal.portal_catalog.getResultValue(\n
  portal_type=\'Purchase Packing List Line\',\n
  simulation_state=state_list,\n
  default_resource_uid=service_uid,\n
  sort_on=((\'movement.start_date\', \'DESC\'),),\n
  aggregate_relative_url=ComplexQuery(\n
    Query(aggregate_relative_url=software_release.getRelativeUrl()),\n
    Query(aggregate_relative_url=computer.getRelativeUrl()),\n
    operator="AND"),\n
)\n
if packing_list_line is None:\n
  return None\n
return packing_list_line.getParentValue()\n
</string> </value>
        </item>
        <item>
            <key> <string>_params</string> </key>
            <value> <string>computer_reference, software_release_reference</string> </value>
        </item>
        <item>
            <key> <string>id</string> </key>
            <value> <string>Agent_getSoftwareReleaseCleanupPackingListOnComputer</string> </value>
        </item>
      </dictionary>
    </pickle>
  </record>
</ZopeData>
