Commit da8d85b7 authored by Romain Courteaud's avatar Romain Courteaud

slapos_accounting: InstanceTree_getSoftwareProduct also return release and type variations

parent 0a28c938
......@@ -168,27 +168,13 @@ if instance_tree.getCausalityState() == 'diverged':
start_date = hosting_subscription.HostingSubscription_calculateSubscriptionStartDate()
# Search for matching resource
service = instance_tree.InstanceTree_getSoftwareProduct()
service, software_release, software_type = instance_tree.InstanceTree_getSoftwareProduct()
if (service is None) or (service.getUse() != 'trade/sale'):
# XXX Add comment on instance tree
return
#raise NotImplementedError('No Software Product defined for %s' % instance_tree.getRelativeUrl())
#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"
)
if software_type is None:
# XXX add comment on instance tree
return
# Sale Supply price do not match Open Order
# Create a temp Sale Order to calculate the real price
......
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