Commit 5a031c27 authored by Łukasz Nowak's avatar Łukasz Nowak

Allocate after confirmation.

It allows interaction to work in correct sequence.
parent 32df7a5c
...@@ -85,13 +85,13 @@ def assignComputerPartition(order):\n ...@@ -85,13 +85,13 @@ def assignComputerPartition(order):\n
software_instance.getPortalType(), software_instance.getSlaXmlAsDict()])\n software_instance.getPortalType(), software_instance.getSlaXmlAsDict()])\n
order_line.edit(\n order_line.edit(\n
aggregate_list=order_line.getAggregateList()+[computer_partition_relative_url])\n aggregate_list=order_line.getAggregateList()+[computer_partition_relative_url])\n
software_instance.allocatePartition(computer_partition=computer_partition_relative_url)\n return (software_instance, computer_partition_relative_url)\n
return computer_partition_relative_url\n return (None, None)\n
\n \n
sale_order = context.getParentValue()\n sale_order = context.getParentValue()\n
if sale_order.getSimulationState() == \'ordered\':\n if sale_order.getSimulationState() == \'ordered\':\n
try:\n try:\n
computer_partition = assignComputerPartition(sale_order)\n software_instance, computer_partition = assignComputerPartition(sale_order)\n
except ValueError:\n except ValueError:\n
# It was not possible to find free Computer Partition\n # It was not possible to find free Computer Partition\n
pass\n pass\n
...@@ -108,6 +108,7 @@ if sale_order.getSimulationState() == \'ordered\':\n ...@@ -108,6 +108,7 @@ if sale_order.getSimulationState() == \'ordered\':\n
else:\n else:\n
sale_order.setStartDate(DateTime())\n sale_order.setStartDate(DateTime())\n
sale_order.confirm()\n sale_order.confirm()\n
software_instance.allocatePartition(computer_partition=computer_partition)\n
</string> </value> </string> </value>
</item> </item>
<item> <item>
......
726 727
\ 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