<?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 encoding="cdata"><![CDATA[

from DateTime import DateTime\n
\n
portal = context.getPortalObject()\n
software_release = context\n
\n
source_product = portal.restrictedTraverse(source_url, None)\n
if not source_product:\n
  return\n
\n
portal_type = source_product.getPortalType()\n
if portal_type == \'Computer\':\n
  person_url = source_product.getSourceAdministration()\n
elif portal_type == \'Hosting Subscription\':\n
  person_url = source_product.getDestinationSection()\n
else:\n
  return\n
\n
if not person_url:\n
  return\n
\n
upgrade_decision = portal.upgrade_decision_module.\\\n
            template_upgrade_decision.Base_createCloneDocument(batch_mode=1)\n
\n
upgrade_decision.edit(title=title)\n
\n
upgrade_decision.setDestinationSection(person_url)\n
upgrade_decision.setDestinationDecision(person_url)\n
\n
decision_line_list = upgrade_decision.contentValues(\n
                    portal_type=\'Upgrade Decision Line\')\n
if len(decision_line_list) > 0:\n
  decision_line = decision_line_list[0]\n
else:\n
  decision_line = upgrade_decision.newContent(\n
                    portal_type=\'Upgrade Decision Line\')\n
\n
decision_line.edit(\n
  title=\'Request decision upgrade for %s on %s %s\' % (\n
    software_release.getTitle(), portal_type, source_product.getReference()),\n
  aggregate=[source_url, software_release.getRelativeUrl()])\n
\n
return upgrade_decision\n


]]></string> </value>
        </item>
        <item>
            <key> <string>_params</string> </key>
            <value> <string>source_url, title</string> </value>
        </item>
        <item>
            <key> <string>id</string> </key>
            <value> <string>SoftwareRelease_createUpgradeDecision</string> </value>
        </item>
      </dictionary>
    </pickle>
  </record>
</ZopeData>
