Commit a828e2de authored by Antoine Catton's avatar Antoine Catton

Adapt HostingSubscription_requestRootSoftwareInstance to slave_instance_cleanup merge.

parent 16b07fa0
......@@ -98,11 +98,36 @@ if request_software_instance is None:\n
)\n
\n
if not person_request:\n
request_software_instance.requestSoftwareInstance(\n
software_release=context.getRootSoftwareReleaseUrl(),\n
hosting_subscription_uid=context.getUid(),\n
software_type=context.getSourceReference(),\n
tag=tag)\n
packing_list_line = software_instance.getAggregateRelatedValue(portal_type="Sale Packing List Line")\n
software_release_document = context.portal_catalog.getResultValue(\n
portal_type=\'Software Release\',\n
url_string=context.getRootSoftwareRelease())\n
base_sale_packing_list = packing_list_line.getParentValue()\n
trade_condition = packing_list_line.getSpecialise(portal_type="Sale Trade Condition")\n
sale_order = portal.getDefaultModule(portal_type="Sale Order").newContent(\n
portal_type="Sale Order",\n
destination=base_sale_packing_list.getDestination(),\n
destination_section=base_sale_packing_list.getDestinationSection(),\n
destination_decision=base_sale_packing_list.getDestinationDecision(),\n
start_date=DateTime(),\n
received_date=DateTime(),\n
# XXX Hardcoded values\n
source="organisation_module/vifib_internet",\n
source_section="organisation_module/vifib_internet",\n
price_currency="currency_module/EUR",\n
activate_kw={\'tag\': tag},\n
)\n
\n
setup_service_relative_url = portal.portal_preferences.getPreferredInstanceSetupResource()\n
sale_order.setSpecialise(trade_condition, portal_type="Sale Trade Condition")\n
sale_order_line = sale_order.newContent(\n
portal_type="Sale Order Line",\n
resource=setup_service_relative_url,\n
quantity=1,\n
aggregate_value_list=[request_software_instance,context,software_release_document],\n
activate_kw={\'tag\': tag},\n
)\n
sale_order.order()\n
\n
if context.getRootState() == \'started\':\n
request_software_instance.startRequested()\n
......
491
\ No newline at end of file
492
\ No newline at end of file
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