Commit b44c3112 authored by Łukasz Nowak's avatar Łukasz Nowak

- create packing list only when required

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@43999 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent d989a322
...@@ -53,8 +53,19 @@ ...@@ -53,8 +53,19 @@
<value> <string>software_instance = state_change[\'object\']\n <value> <string>software_instance = state_change[\'object\']\n
service_relative_url = software_instance.portal_preferences.\\\n service_relative_url = software_instance.portal_preferences.\\\n
getPreferredInstanceHostingResource()\n getPreferredInstanceHostingResource()\n
sale_packing_list = context.SoftwareInstance_createSalePackingList(state_change, service_relative_url)\n need_to_create_packing_list = False\n
sale_packing_list.confirm()\n \n
try:\n
sale_packing_list_line = software_instance.SoftwareInstance_getInstanceHostingPackingListLine()\n
except ValueError:\n
need_to_create_packing_list = True\n
else:\n
if sale_packing_list_line.getSimulationState() == \'delivered\':\n
need_to_create_packing_list = True\n
\n
if need_to_create_packing_list:\n
sale_packing_list = context.SoftwareInstance_createSalePackingList(state_change, service_relative_url)\n
sale_packing_list.confirm()\n
</string> </value> </string> </value>
</item> </item>
<item> <item>
...@@ -96,6 +107,11 @@ sale_packing_list.confirm()\n ...@@ -96,6 +107,11 @@ sale_packing_list.confirm()\n
<string>software_instance</string> <string>software_instance</string>
<string>_getattr_</string> <string>_getattr_</string>
<string>service_relative_url</string> <string>service_relative_url</string>
<string>False</string>
<string>need_to_create_packing_list</string>
<string>sale_packing_list_line</string>
<string>ValueError</string>
<string>True</string>
<string>context</string> <string>context</string>
<string>sale_packing_list</string> <string>sale_packing_list</string>
</tuple> </tuple>
......
217 218
\ 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