Commit 8d0d835c authored by Romain Courteaud's avatar Romain Courteaud

slapos_cloud:

* show allocation supply state
* InstanceTree_getSoftwareProduct also return release and type variations
parent 6e96c27f
......@@ -87,7 +87,9 @@
<item>
<key> <string>right</string> </key>
<value>
<list/>
<list>
<string>my_translated_validation_state_title</string>
</list>
</value>
</item>
</dictionary>
......
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ProxyField" module="Products.ERP5Form.ProxyField"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>delegated_list</string> </key>
<value>
<list/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>my_translated_validation_state_title</string> </value>
</item>
<item>
<key> <string>message_values</string> </key>
<value>
<dictionary>
<item>
<key> <string>external_validator_failed</string> </key>
<value> <string>The input failed the external validator.</string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>overrides</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>tales</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>values</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string>my_translated_validation_state_title</string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string>Base_viewPDMFieldLibrary</string> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string>Click to edit the target</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
# set default value of image_url to the panel's logo
image_url = "gadget_slapos_panel.png"
software_product = context.InstanceTree_getSoftwareProduct()
software_product, _, _ = context.InstanceTree_getSoftwareProduct()
if software_product is not None:
product_image_url = software_product.getDefaultImageAbsoluteUrl()
......
portal = context.getPortalObject()
url_string = context.getUrlString()
software_product = None
software_release = None
software_type = None
product_list = portal.portal_catalog(
portal_type="Software Product",
......@@ -9,13 +11,23 @@ product_list = portal.portal_catalog(
follow_up__uid=context.getFollowUpUid()
)
release = portal.portal_catalog.getResultValue(
software_release = portal.portal_catalog.getResultValue(
portal_type="Software Product Release Variation",
url_string=url_string,
parent_uid=[x.getUid() for x in product_list]
)
if release is not None:
software_product = release.getParentValue()
if software_release is not None:
software_product = software_release.getParentValue()
return software_product
software_type = portal.portal_catalog.getResultValue(
parent_uid=software_product.getUid(),
title=context.getSourceReference(),
portal_type="Software Product Type Variation"
)
if software_type is None:
software_release = None
software_product = None
return software_product, software_release, software_type
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