Commit 0d01172b authored by Romain Courteaud's avatar Romain Courteaud

Do not display the frightening meaningless "Destroyed" status

parent b6af0592
......@@ -80,7 +80,7 @@ state_list.extend(portal.getPortalTransitInventoryStateList())\n
state_list.extend(portal.getPortalCurrentInventoryStateList())\n
\n
packing_list_line = portal.portal_catalog.getResultValue(\n
portal_type=\'Sale Packing List Line\',\n
portal_type=portal_type,\n
simulation_state=state_list,\n
aggregate_uid=software_instance.getUid(),\n
default_resource_uid=service_uid_list,\n
......@@ -95,7 +95,7 @@ return packing_list_line\n
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>service_relative_url=None</string> </value>
<value> <string>service_relative_url=None, portal_type="Sale Packing List Line"</string> </value>
</item>
<item>
<key> <string>id</string> </key>
......
......@@ -56,7 +56,11 @@ if context.getPortalType() == "Sale Order Line":\n
\n
sale_packing_list_line = context.SoftwareInstance_getInstancePackingListLine()\n
if sale_packing_list_line is None:\n
return \'Destroyed\'\n
sale_packing_list_line = context.SoftwareInstance_getInstancePackingListLine(portal_type="Sale Order Line")\n
if sale_packing_list_line is None:\n
# Let\'s hope the sale order is not indexed yet\n
return \'Looking for a free partition\'\n
\n
service_url = sale_packing_list_line.getResource()\n
\n
portal_preferences = context.getPortalObject().portal_preferences\n
......@@ -66,6 +70,8 @@ if service_url == portal_preferences.getPreferredInstanceSetupResource():\n
return \'Destroyed\'\n
elif simulation_state in (\'confirmed\', \'started\'):\n
return \'Instanciation in progress\'\n
elif simulation_state in (\'ordered\', ):\n
return \'Looking for a free partition\'\n
return \'Stopped\'\n
elif service_url == portal_preferences.getPreferredInstanceCleanupResource():\n
if simulation_state == \'delivered\':\n
......@@ -80,8 +86,8 @@ elif service_url == portal_preferences.getPreferredInstanceHostingResource():\n
return \'Stop in progress\'\n
elif simulation_state == \'delivered\':\n
return \'Stopped\'\n
else:\n
return \'Unknown\'\n
\n
return \'Unable to calculate the status...\'\n
</string> </value>
</item>
<item>
......
590
\ No newline at end of file
591
\ 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