Commit fc94ba08 authored by Romain Courteaud's avatar Romain Courteaud

slapos_panel: use Allocation Supply to return the list of Software Product

parent af61be0e
from Products.CMFCore.utils import getToolByName
project = context
portal = project.getPortalObject()
domain_tool = getToolByName(portal, 'portal_domains')
software_product_list = portal.portal_catalog(
portal_type='Software Product',
follow_up__uid=context.getUid(),
validation_state=['validated', 'published']
tmp_context = portal.portal_trash.newContent(
portal_type='Movement',
temp_object=1,
#resource_value=software_product,
#software_type_value=type_variation,
#software_release_value=release_variation,
destination_value=portal.portal_membership.getAuthenticatedMember().getUserValue(),
destination_project_value=project,
start_date=DateTime()
)
software_product_list = list(set([x.getObject().getParentValue().getResourceValue() for x in \
domain_tool.searchPredicateList(tmp_context, portal_type=['Allocation Supply Cell'],
tested_base_category_list=['destination_project', 'destination'])]))
if project.getDestinationSection(None) is None:
# User virtual master
# No need to pay anything for the instance
......
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