<?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 = state_change[\'object\']\n
portal = computer.getPortalObject()\n
\n
# reference = computer.getReference("")\n
# if not reference:\n
#   computer.edit(reference=portal.portal_ids.generateNewId(\n
#     id_group=\'slap_computer_reference\',\n
#     id_generator=\'mysql_non_continuous_increasing\'))\n
\n
# Access internal packing list module\n
internal_packing_list_id = portal.getDefaultModuleId(portal_type=\'Internal Packing List\')\n
internal_packing_list_module = portal.restrictedTraverse(internal_packing_list_id)\n
# Create the IPL\n
internal_packing_list = internal_packing_list_module.newContent(\n
  portal_type=\'Internal Packing List\',\n
)\n
# User has to access his person profile\n
person_value = portal.ERP5Site_getAuthenticatedMemberPersonValue()\n
# Edit IPL data\n
internal_packing_list.edit(\n
  start_date=DateTime(),\n
  source_administration_value=person_value,\n
  destination_value=person_value,\n
  destination_section_value=person_value,\n
)\n
\n
# Access service\n
service_module_id = portal.getDefaultModuleId(portal_type=\'Service\')\n
service_module = portal.restrictedTraverse(service_module_id)\n
service_value = service_module.restrictedTraverse(\'computer_registration\')\n
# Edit line\n
internal_packing_list_line = internal_packing_list.newContent(\n
  portal_type=\'Internal Packing List Line\',\n
  resource_value=service_value,\n
  quantity=1,\n
  aggregate_value=computer,\n
)\n
\n
# Deliver IPL\n
internal_packing_list.portal_workflow.doActionFor(internal_packing_list, \'confirm_action\')\n
internal_packing_list.portal_workflow.doActionFor(internal_packing_list, \'stop_action\')\n
\n
internal_packing_list.startBuilding()\n
\n
computer.createComputerRegistration(internal_packing_list_url=internal_packing_list.getRelativeUrl())\n
</string> </value>
        </item>
        <item>
            <key> <string>_params</string> </key>
            <value> <string>state_change</string> </value>
        </item>
        <item>
            <key> <string>id</string> </key>
            <value> <string>Computer_requestRegistration</string> </value>
        </item>
      </dictionary>
    </pickle>
  </record>
</ZopeData>
