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 @@ ...@@ -86,7 +86,7 @@
</item> </item>
<item> <item>
<key> <string>test_tales_expression</string> </key> <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>
<item> <item>
<key> <string>use_acquisition</string> </key> <key> <string>use_acquisition</string> </key>
......
407 408
\ No newline at end of file \ No newline at end of file
...@@ -84,11 +84,12 @@ def assignComputerPartition(order):\n ...@@ -84,11 +84,12 @@ 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
return computer_partition_relative_url\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
assignComputerPartition(sale_order)\n computer_partition = getComputerPartition(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
...@@ -96,6 +97,7 @@ if sale_order.getSimulationState() == \'ordered\':\n ...@@ -96,6 +97,7 @@ if sale_order.getSimulationState() == \'ordered\':\n
# user has bad balance\n # user has bad balance\n
pass\n pass\n
else:\n else:\n
if computer_partition is not None:\n
try:\n try:\n
sale_order.Base_checkConsistency()\n sale_order.Base_checkConsistency()\n
except ValidationFailed:\n except ValidationFailed:\n
......
654 655
\ 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