Commit 92ad87f0 authored by Antoine Catton's avatar Antoine Catton

Do not create Open Sale Order Line as software instance.

parent 954394bc
...@@ -132,7 +132,7 @@ if (request_software_instance is None):\n ...@@ -132,7 +132,7 @@ if (request_software_instance is None):\n
aggregate_value_list=[request_software_instance,\n aggregate_value_list=[request_software_instance,\n
hosting_subscription,\n hosting_subscription,\n
software_release_document\n software_release_document\n
],\n ],\n
activate_kw={\'tag\': tag},\n activate_kw={\'tag\': tag},\n
)\n )\n
#portal.portal_workflow.doActionFor(sale_order, "order_action")\n #portal.portal_workflow.doActionFor(sale_order, "order_action")\n
...@@ -156,31 +156,31 @@ if (request_software_instance is None):\n ...@@ -156,31 +156,31 @@ if (request_software_instance is None):\n
else:\n else:\n
raise ValueError(\'Person has no open order created\')\n raise ValueError(\'Person has no open order created\')\n
\n \n
now = DateTime()\n now = DateTime()\n
start_date = getClosestDate(target_date=now, precision=\'day\', before=1)\n start_date = getClosestDate(target_date=now, precision=\'day\', before=1)\n
# 12 months of subscription by default\n # 12 months of subscription by default\n
stop_date = addToDate(getClosestDate(target_date=now, precision=\'month\', before=1), year=1)\n stop_date = addToDate(getClosestDate(target_date=now, precision=\'month\', before=1), year=1)\n
\n \n
subscription_service_relative_url = portal.portal_preferences.getPreferredInstanceSubscriptionResource()\n subscription_service_relative_url = portal.portal_preferences.getPreferredInstanceSubscriptionResource()\n
open_order.newContent(\n open_order.newContent(\n
portal_type="Open Sale Order Line",\n portal_type="Open Sale Order Line",\n
title=hosting_subscription.getTitle(),\n title=hosting_subscription.getTitle(),\n
aggregate_value=hosting_subscription,\n aggregate_value=hosting_subscription,\n
start_date=start_date,\n start_date=start_date,\n
stop_date=stop_date,\n stop_date=stop_date,\n
quantity=1,\n quantity=1,\n
quantity_unit="unit/piece",\n quantity_unit="unit/piece",\n
price=1,\n price=1,\n
price_currency="currency_module/EUR",\n price_currency="currency_module/EUR",\n
specialise=sale_order.getSpecialise(portal_type="Sale Trade Condition"),\n specialise=sale_order.getSpecialise(portal_type="Sale Trade Condition"),\n
# XXX Hardcoded values\\n\n # XXX Hardcoded values\\n\n
resource=subscription_service_relative_url,\n resource=subscription_service_relative_url,\n
destination=person_relative_url,\n destination=person_relative_url,\n
destination_section=person_relative_url,\n destination_section=person_relative_url,\n
source="organisation_module/vifib_internet",\n source="organisation_module/vifib_internet",\n
source_section="organisation_module/vifib_internet",\n source_section="organisation_module/vifib_internet",\n
activate_kw={\'tag\': tag},\n activate_kw={\'tag\': tag},\n
)\n )\n
\n \n
hosting_subscription_predecessor_list = hosting_subscription.getPredecessorList()\n hosting_subscription_predecessor_list = hosting_subscription.getPredecessorList()\n
hosting_subscription_predecessor_list.append(request_software_instance.getRelativeUrl())\n hosting_subscription_predecessor_list.append(request_software_instance.getRelativeUrl())\n
......
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