Commit 676486db authored by Romain Courteaud's avatar Romain Courteaud

slapos_panel: drop unused script

parent ecdf4c5c
from Products.CMFCore.utils import getToolByName
project = context
portal = project.getPortalObject()
domain_tool = getToolByName(portal, 'portal_domains')
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
# XXX filter by Allocation Supply
return software_product_list
result_list = []
for software_product in software_product_list:
# XXX be careful not acquiring categories from parent
movement = project.getParentValue().newContent(
#portal_type='Open Sale Order Line',
portal_type='Sale Order Line',
temp_object=True,
id=project.getId(),
uid=project.getUid(),
quantity=1,
#source=project.getSource(),
#source_section=project.getSourceSection(),
#destination=project.getDestination(),
#destination_section=project.getDestinationSection(),
#destination_project_value=project,
resource_value=software_product,
)
if movement.getPrice() is not None:
result_list.append(movement)
movement.setTitle('%s %s' % (software_product.getTitle(), movement.getPrice()))
return result_list
#return [x.asContext(title='%s %s' % (x.getTitle(), x.getPrice())) for x in software_product_list if x.getPrice(None) is not None]
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>Script_magic</string> </key>
<value> <int>3</int> </value>
</item>
<item>
<key> <string>_bind_names</string> </key>
<value>
<object>
<klass>
<global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key> <string>_asgns</string> </key>
<value>
<dictionary>
<item>
<key> <string>name_container</string> </key>
<value> <string>container</string> </value>
</item>
<item>
<key> <string>name_context</string> </key>
<value> <string>context</string> </value>
</item>
<item>
<key> <string>name_m_self</string> </key>
<value> <string>script</string> </value>
</item>
<item>
<key> <string>name_subpath</string> </key>
<value> <string>traverse_subpath</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>Project_getProductList</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
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