Commit ac7c11e4 authored by Romain Courteaud's avatar Romain Courteaud

slapos_accounting: select the correct software release/type on open order

parent 69c9bcb3
...@@ -90,11 +90,23 @@ if instance_tree.getCausalityState() == 'diverged': ...@@ -90,11 +90,23 @@ if instance_tree.getCausalityState() == 'diverged':
raise NotImplementedError('No Software Product defined for %s' % instance_tree.getRelativeUrl()) raise NotImplementedError('No Software Product defined for %s' % instance_tree.getRelativeUrl())
#assert instance_tree.getPortalType() in service.getRequiredAggregatedPortalTypeList() #assert instance_tree.getPortalType() in service.getRequiredAggregatedPortalTypeList()
software_release = portal.portal_catalog.getResultValue(
parent_uid=service.getUid(),
url_string=instance_tree.getUrlString(),
portal_type="Software Product Release Variation"
)
software_type = portal.portal_catalog.getResultValue(
parent_uid=service.getUid(),
title=instance_tree.getSourceReference(),
portal_type="Software Product Type Variation"
)
resource_vcl = list(service.getVariationCategoryList( resource_vcl = [
omit_individual_variation=0)) 'software_release/%s' % software_release.getRelativeUrl(),
'software_type/%s' % software_type.getRelativeUrl()
]
resource_vcl.sort() resource_vcl.sort()
assert len(resource_vcl) != 0, service assert len(resource_vcl) == 2, service
edit_kw = { edit_kw = {
'resource_value': service, 'resource_value': service,
......
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