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,13 +97,14 @@ if sale_order.getSimulationState() == \'ordered\':\n ...@@ -96,13 +97,14 @@ if sale_order.getSimulationState() == \'ordered\':\n
# user has bad balance\n # user has bad balance\n
pass\n pass\n
else:\n else:\n
try:\n if computer_partition is not None:\n
sale_order.Base_checkConsistency()\n try:\n
except ValidationFailed:\n sale_order.Base_checkConsistency()\n
# order not ready yet\n except ValidationFailed:\n
pass\n # order not ready yet\n
else:\n pass\n
sale_order.confirm()\n else:\n
sale_order.confirm()\n
</string> </value> </string> </value>
</item> </item>
<item> <item>
......
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