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