Commit f6275726 authored by Gabriel Monnerat's avatar Gabriel Monnerat

change the parameter of "ERP5Site_getSlaveInstanceListFromComputerPartition"...

change the parameter of "ERP5Site_getSlaveInstanceListFromComputerPartition" to be possible to pass parameters to catalog search
parent dd98131b
...@@ -63,10 +63,7 @@ sale_packing_list_line = portal.portal_catalog.getResultValue(\n ...@@ -63,10 +63,7 @@ sale_packing_list_line = portal.portal_catalog.getResultValue(\n
computer_partition = sale_packing_list_line.getAggregateValue(\n computer_partition = sale_packing_list_line.getAggregateValue(\n
portal_type="Computer Partition")\n portal_type="Computer Partition")\n
\n \n
slave_instance_query = ComplexQuery(\n slave_instance_query = Query(aggregate_portal_type="Slave Instance")\n
Query(aggregate_portal_type="Slave Instance"),\n
Query(aggregate_validation_state=state_list),\n
operator="AND")\n
\n \n
computer_partition_query = Query(\n computer_partition_query = Query(\n
aggregate_relative_url=computer_partition.getRelativeUrl())\n aggregate_relative_url=computer_partition.getRelativeUrl())\n
...@@ -74,9 +71,6 @@ computer_partition_query = Query(\n ...@@ -74,9 +71,6 @@ computer_partition_query = Query(\n
query = ComplexQuery(computer_partition_query, \n query = ComplexQuery(computer_partition_query, \n
slave_instance_query, operator="AND")\n slave_instance_query, operator="AND")\n
\n \n
kw = {}\n
if simulation_state is not None:\n
kw["simulation_state"] = simulation_state\n
return portal.portal_catalog(portal_type=\'Sale Packing List Line\',\n return portal.portal_catalog(portal_type=\'Sale Packing List Line\',\n
default_resource_uid=service_uid_list,\n default_resource_uid=service_uid_list,\n
sort_on=((\'movement.start_date\', \'DESC\'),),\n sort_on=((\'movement.start_date\', \'DESC\'),),\n
...@@ -85,7 +79,7 @@ return portal.portal_catalog(portal_type=\'Sale Packing List Line\',\n ...@@ -85,7 +79,7 @@ return portal.portal_catalog(portal_type=\'Sale Packing List Line\',\n
</item> </item>
<item> <item>
<key> <string>_params</string> </key> <key> <string>_params</string> </key>
<value> <string>relative_url, service_relative_url, state_list, simulation_state=None</string> </value> <value> <string>relative_url, service_relative_url, **kw</string> </value>
</item> </item>
<item> <item>
<key> <string>id</string> </key> <key> <string>id</string> </key>
......
...@@ -55,8 +55,7 @@ service_relative_url = software_instance.portal_preferences.\\\n ...@@ -55,8 +55,7 @@ service_relative_url = software_instance.portal_preferences.\\\n
getPreferredInstanceHostingResource()\n getPreferredInstanceHostingResource()\n
\n \n
sale_packing_list_line_list = context.ERP5Site_getSlaveInstanceListFromComputerPartition(\n sale_packing_list_line_list = context.ERP5Site_getSlaveInstanceListFromComputerPartition(\n
software_instance.getRelativeUrl(), service_relative_url,\n software_instance.getRelativeUrl(), service_relative_url, simulation_state=["stopped"])\n
["%requested", "started"], "stopped")\n
\n \n
for sale_packing_list_line in sale_packing_list_line_list:\n for sale_packing_list_line in sale_packing_list_line_list:\n
slave_instance = sale_packing_list_line.getAggregateValue(portal_type="Slave Instance")\n slave_instance = sale_packing_list_line.getAggregateValue(portal_type="Slave Instance")\n
......
...@@ -55,11 +55,15 @@ service_relative_url = software_instance.portal_preferences.\\\n ...@@ -55,11 +55,15 @@ service_relative_url = software_instance.portal_preferences.\\\n
getPreferredInstanceHostingResource()\n getPreferredInstanceHostingResource()\n
\n \n
sale_packing_list_line_list = context.ERP5Site_getSlaveInstanceListFromComputerPartition(\n sale_packing_list_line_list = context.ERP5Site_getSlaveInstanceListFromComputerPartition(\n
software_instance.getRelativeUrl(), service_relative_url, ["%requested", "stopped"])\n software_instance.getRelativeUrl(), service_relative_url)\n
\n
slave_instance_uid_list = []\n
\n \n
for sale_packing_list_line in sale_packing_list_line_list:\n for sale_packing_list_line in sale_packing_list_line_list:\n
slave_instance = sale_packing_list_line.getAggregateValue(portal_type="Slave Instance")\n slave_instance = sale_packing_list_line.getAggregateValue(portal_type="Slave Instance")\n
if slave_instance.getUid() not in slave_instance_uid_list:\n
slave_instance.requestStartComputerPartition()\n slave_instance.requestStartComputerPartition()\n
slave_instance_uid_list.append(slave_instance.getUid())\n
</string> </value> </string> </value>
</item> </item>
<item> <item>
......
...@@ -55,7 +55,8 @@ service_relative_url = software_instance.portal_preferences.\\\n ...@@ -55,7 +55,8 @@ service_relative_url = software_instance.portal_preferences.\\\n
getPreferredInstanceHostingResource()\n getPreferredInstanceHostingResource()\n
\n \n
sale_packing_list_line_list = context.ERP5Site_getSlaveInstanceListFromComputerPartition(\n sale_packing_list_line_list = context.ERP5Site_getSlaveInstanceListFromComputerPartition(\n
software_instance.getRelativeUrl(), service_relative_url, ["%requested", "started"])\n software_instance.getRelativeUrl(), service_relative_url,\n
simulation_state=["confirmed", "started"])\n
\n \n
for sale_packing_list_line in sale_packing_list_line_list:\n for sale_packing_list_line in sale_packing_list_line_list:\n
slave_instance = sale_packing_list_line.getAggregateValue(portal_type="Slave Instance")\n slave_instance = sale_packing_list_line.getAggregateValue(portal_type="Slave Instance")\n
......
...@@ -55,7 +55,7 @@ service_relative_url = software_instance.portal_preferences.\\\n ...@@ -55,7 +55,7 @@ service_relative_url = software_instance.portal_preferences.\\\n
getPreferredInstanceSetupResource()\n getPreferredInstanceSetupResource()\n
\n \n
sale_packing_list_line_list = context.ERP5Site_getSlaveInstanceListFromComputerPartition(\n sale_packing_list_line_list = context.ERP5Site_getSlaveInstanceListFromComputerPartition(\n
software_instance.getRelativeUrl(), service_relative_url, ["%requested", "stopped"])\n software_instance.getRelativeUrl(), service_relative_url)\n
\n \n
for sale_packing_list_line in sale_packing_list_line_list:\n for sale_packing_list_line in sale_packing_list_line_list:\n
slave_instance = sale_packing_list_line.getAggregateValue(portal_type="Slave Instance")\n slave_instance = sale_packing_list_line.getAggregateValue(portal_type="Slave Instance")\n
......
...@@ -55,7 +55,7 @@ service_relative_url = software_instance.portal_preferences.\\\n ...@@ -55,7 +55,7 @@ service_relative_url = software_instance.portal_preferences.\\\n
getPreferredInstanceHostingResource()\n getPreferredInstanceHostingResource()\n
\n \n
sale_packing_list_line_list = context.ERP5Site_getSlaveInstanceListFromComputerPartition(\n sale_packing_list_line_list = context.ERP5Site_getSlaveInstanceListFromComputerPartition(\n
software_instance.getRelativeUrl(), service_relative_url, ["%requested", "stopped"])\n software_instance.getRelativeUrl(), service_relative_url)\n
\n \n
for sale_packing_list_line in sale_packing_list_line_list:\n for sale_packing_list_line in sale_packing_list_line_list:\n
slave_instance = sale_packing_list_line.getAggregateValue(portal_type="Slave Instance")\n slave_instance = sale_packing_list_line.getAggregateValue(portal_type="Slave Instance")\n
......
...@@ -54,7 +54,7 @@ ...@@ -54,7 +54,7 @@
service_relative_url = software_instance.portal_preferences.\\\n service_relative_url = software_instance.portal_preferences.\\\n
getPreferredInstanceSetupResource()\n getPreferredInstanceSetupResource()\n
sale_packing_list_line_list = context.ERP5Site_getSlaveInstanceListFromComputerPartition(\n sale_packing_list_line_list = context.ERP5Site_getSlaveInstanceListFromComputerPartition(\n
software_instance.getRelativeUrl(), service_relative_url, ["%requested", "started"])\n software_instance.getRelativeUrl(), service_relative_url)\n
\n \n
for sale_packing_list_line in sale_packing_list_line_list:\n for sale_packing_list_line in sale_packing_list_line_list:\n
slave_instance = sale_packing_list_line.getAggregateValue(portal_type="Slave Instance")\n slave_instance = sale_packing_list_line.getAggregateValue(portal_type="Slave Instance")\n
......
...@@ -55,7 +55,7 @@ service_relative_url = software_instance.portal_preferences.\\\n ...@@ -55,7 +55,7 @@ service_relative_url = software_instance.portal_preferences.\\\n
getPreferredInstanceHostingResource()\n getPreferredInstanceHostingResource()\n
\n \n
sale_packing_list_line_list = context.ERP5Site_getSlaveInstanceListFromComputerPartition(\n sale_packing_list_line_list = context.ERP5Site_getSlaveInstanceListFromComputerPartition(\n
software_instance.getRelativeUrl(), service_relative_url, ["%requested", "started"])\n software_instance.getRelativeUrl(), service_relative_url)\n
\n \n
for sale_packing_list_line in sale_packing_list_line_list:\n for sale_packing_list_line in sale_packing_list_line_list:\n
slave_instance = sale_packing_list_line.getAggregateValue(portal_type="Slave Instance")\n slave_instance = sale_packing_list_line.getAggregateValue(portal_type="Slave Instance")\n
......
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