Commit e83b63a6 authored by Romain Courteaud's avatar Romain Courteaud

First version of computer registration approval.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@42504 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent f002d43e
......@@ -53,21 +53,15 @@
<value> <string>computer = state_change[\'object\']\n
portal = computer.getPortalObject()\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
internal_packing_list_url = context.portal_workflow.getInfoFor(\n
ob=computer, name=\'internal_packing_list_url\', \n
wf_id=\'computer_slap_interface_workflow\')\n
\n
internal_packing_list_line = portal.portal_catalog.getResultValue(\n
portal_type=\'Internal Packing List Line\',\n
simulation_state=\'stopped\',\n
resource_value=service_value,\n
aggregate_value=computer,\n
)\n
if (internal_packing_list_line is not None):\n
internal_packing_list = internal_packing_list_line.getParentValue()\n
portal.portal_workflow.doActionFor(internal_packing_list, \'deliver_action\')\n
portal.portal_workflow.doActionFor(computer, \'validate_action\')\n
internal_packing_list = portal.restrictedTraverse(internal_packing_list_url)\n
\n
# portal.portal_workflow.doActionFor(internal_packing_list, \'deliver_action\')\n
internal_packing_list.deliver()\n
portal.portal_workflow.doActionFor(computer, \'validate_action\')\n
</string> </value>
</item>
<item>
......@@ -115,11 +109,8 @@ if (internal_packing_list_line is not None):\n
<string>computer</string>
<string>_getattr_</string>
<string>portal</string>
<string>service_module_id</string>
<string>service_module</string>
<string>service_value</string>
<string>internal_packing_list_line</string>
<string>None</string>
<string>context</string>
<string>internal_packing_list_url</string>
<string>internal_packing_list</string>
</tuple>
</value>
......
......@@ -53,11 +53,11 @@
<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
# 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
......@@ -92,6 +92,8 @@ internal_packing_list_line = internal_packing_list.newContent(\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
computer.createComputerRegistration(internal_packing_list_url=internal_packing_list.getRelativeUrl())\n
</string> </value>
</item>
<item>
......@@ -139,7 +141,6 @@ internal_packing_list.portal_workflow.doActionFor(internal_packing_list, \'stop_
<string>computer</string>
<string>_getattr_</string>
<string>portal</string>
<string>reference</string>
<string>internal_packing_list_id</string>
<string>internal_packing_list_module</string>
<string>internal_packing_list</string>
......
......@@ -22,6 +22,8 @@
<key> <string>transitions</string> </key>
<value>
<tuple>
<string>approve_computer_registration</string>
<string>create_computer_registration</string>
<string>report_software_release_installation_error</string>
<string>request_computer_registration</string>
<string>start_software_release_installation</string>
......
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="TransitionDefinition" module="Products.DCWorkflow.Transitions"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>actbox_category</string> </key>
<value> <string>workflow</string> </value>
</item>
<item>
<key> <string>actbox_icon</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>actbox_name</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>actbox_url</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>after_script_name</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>guard</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>create_computer_registration</string> </value>
</item>
<item>
<key> <string>new_state_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>script_name</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>trigger_type</string> </key>
<value> <int>2</int> </value>
</item>
<item>
<key> <string>var_exprs</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="PersistentMapping" module="Persistence.mapping"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>data</string> </key>
<value>
<dictionary>
<item>
<key> <string>internal_packing_list_url</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle>
<global name="Expression" module="Products.CMFCore.Expression"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>text</string> </key>
<value> <string>python:state_change.kwargs.get(\'internal_packing_list_url\', \'\')</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="VariableDefinition" module="Products.DCWorkflow.Variables"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>default_expr</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>default_value</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>for_catalog</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>for_status</string> </key>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>internal_packing_list_url</string> </value>
</item>
<item>
<key> <string>info_guard</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>update_always</string> </key>
<value> <int>0</int> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
320
\ No newline at end of file
321
\ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment