Commit 096f60b4 authored by Łukasz Nowak's avatar Łukasz Nowak

Stabilise.

Confirmed Sale Order Line shall have Computer Partition.
parent e93c0ac3
......@@ -86,7 +86,7 @@
</item>
<item>
<key> <string>test_tales_expression</string> </key>
<value> <string>python: object.getResourceValue() is not None and object.getResource() in [object.portal_preferences.getPreferredInstanceSetupResource(), object.portal_preferences.getPreferredInstanceHostingResource(), object.portal_preferences.getPreferredInstanceCleanupResource()]</string> </value>
<value> <string>python: object.getSimulationState() == \'confirmed\' and object.getResourceValue() is not None and object.getResource() in [object.portal_preferences.getPreferredInstanceSetupResource(), object.portal_preferences.getPreferredInstanceHostingResource(), object.portal_preferences.getPreferredInstanceCleanupResource()]</string> </value>
</item>
<item>
<key> <string>use_acquisition</string> </key>
......
407
\ No newline at end of file
408
\ No newline at end of file
......@@ -84,11 +84,12 @@ def assignComputerPartition(order):\n
software_instance.getPortalType(), software_instance.getSlaXmlAsDict()])\n
order_line.edit(\n
aggregate_list=order_line.getAggregateList()+[computer_partition_relative_url])\n
return computer_partition_relative_url\n
\n
sale_order = context.getParentValue()\n
if sale_order.getSimulationState() == \'ordered\':\n
try:\n
assignComputerPartition(sale_order)\n
computer_partition = getComputerPartition(sale_order)\n
except ValueError:\n
# It was not possible to find free Computer Partition\n
pass\n
......@@ -96,13 +97,14 @@ if sale_order.getSimulationState() == \'ordered\':\n
# user has bad balance\n
pass\n
else:\n
try:\n
sale_order.Base_checkConsistency()\n
except ValidationFailed:\n
# order not ready yet\n
pass\n
else:\n
sale_order.confirm()\n
if computer_partition is not None:\n
try:\n
sale_order.Base_checkConsistency()\n
except ValidationFailed:\n
# order not ready yet\n
pass\n
else:\n
sale_order.confirm()\n
</string> </value>
</item>
<item>
......
654
\ No newline at end of file
655
\ 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