Commit 67024ee3 authored by Łukasz Nowak's avatar Łukasz Nowak

Person shall not modify open order.

parent b70391e9
...@@ -139,35 +139,6 @@ if (request_software_instance is None):\n ...@@ -139,35 +139,6 @@ if (request_software_instance is None):\n
# XXX: Do not verify security\n # XXX: Do not verify security\n
sale_order.order()\n sale_order.order()\n
\n \n
if person is not None:\n
# Update Open Order\n
# does this order have a client-specific Open Order\n
open_order = portal.portal_catalog.getResultValue(\n
default_destination_section_uid=person.getUid(),\n
portal_type="Open Sale Order",\n
validation_state="validated")\n
if open_order is None:\n
raise ValueError(\'Person has no open order created\')\n
\n
now = DateTime()\n
start_date = getClosestDate(target_date=now, precision=\'day\', before=1)\n
# 12 months of subscription by default\n
stop_date = addToDate(getClosestDate(target_date=now, precision=\'month\', before=1), month=1)\n
\n
subscription_service_relative_url = portal.portal_preferences.getPreferredInstanceSubscriptionResource()\n
open_order.getDestinationDecisionValue().Person_updateOpenOrder(add_kw=dict(\n
portal_type="Open Sale Order Line",\n
title=hosting_subscription.getTitle(),\n
aggregate_value=hosting_subscription,\n
start_date=start_date,\n
stop_date=stop_date,\n
quantity=1,\n
quantity_unit="unit/piece",\n
# XXX Hardcoded values\\n\n
resource=subscription_service_relative_url,\n
price=context.restrictedTraverse(subscription_service_relative_url).getSaleSupplyLineBasePrice(),\n
tag=tag\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
hosting_subscription.edit(predecessor_list=hosting_subscription_predecessor_list)\n hosting_subscription.edit(predecessor_list=hosting_subscription_predecessor_list)\n
......
618 619
\ No newline at end of file \ 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