Commit 06a03c1e authored by Rafael Monnerat's avatar Rafael Monnerat

Filter by resource to select the appropriate movement.

This change is required to not return more movements that is expected.
parent 15fb044c
...@@ -53,25 +53,36 @@ ...@@ -53,25 +53,36 @@
<value> <string>from Products.ZSQLCatalog.SQLCatalog import Query, ComplexQuery\n <value> <string>from Products.ZSQLCatalog.SQLCatalog import Query, ComplexQuery\n
portal = context.getPortalObject()\n portal = context.getPortalObject()\n
\n \n
service = portal.restrictedTraverse(service_relative_url)\n
service_uid_list = [service.getUid()]\n
\n
sale_packing_list_line = portal.portal_catalog.getResultValue(\n sale_packing_list_line = portal.portal_catalog.getResultValue(\n
portal_type="Sale Packing List Line",\n portal_type="Sale Packing List Line",\n
aggregate_relative_url=relative_url)\n aggregate_relative_url=relative_url)\n
computer_partition = sale_packing_list_line.getAggregateValue(portal_type="Computer Partition")\n \n
computer_partition = sale_packing_list_line.getAggregateValue(\n
portal_type="Computer Partition")\n
\n \n
slave_instance_query = ComplexQuery(\n slave_instance_query = ComplexQuery(\n
Query(aggregate_portal_type="Slave Instance"),\n Query(aggregate_portal_type="Slave Instance"),\n
Query(aggregate_validation_state=state_list),\n Query(aggregate_validation_state=state_list),\n
operator="AND")\n operator="AND")\n
\n \n
computer_partition_query = Query(aggregate_relative_url=computer_partition.getRelativeUrl())\n computer_partition_query = Query(\n
query = ComplexQuery(computer_partition_query, slave_instance_query, operator="AND")\n aggregate_relative_url=computer_partition.getRelativeUrl())\n
\n
query = ComplexQuery(computer_partition_query, \n
slave_instance_query, operator="AND")\n
\n \n
return portal.portal_catalog(portal_type=\'Sale Packing List Line\', query=query)\n return portal.portal_catalog(portal_type=\'Sale Packing List Line\', \n
default_resource_uid=service_uid_list,\n
sort_on=((\'movement.start_date\', \'DESC\'),),\n
query=query)\n
</string> </value> </string> </value>
</item> </item>
<item> <item>
<key> <string>_params</string> </key> <key> <string>_params</string> </key>
<value> <string>relative_url, state_list</string> </value> <value> <string>relative_url, service_relative_url, state_list</string> </value>
</item> </item>
<item> <item>
<key> <string>id</string> </key> <key> <string>id</string> </key>
......
...@@ -51,8 +51,11 @@ ...@@ -51,8 +51,11 @@
<item> <item>
<key> <string>_body</string> </key> <key> <string>_body</string> </key>
<value> <string>software_instance = state_change["object"]\n <value> <string>software_instance = state_change["object"]\n
service_relative_url = software_instance.portal_preferences.\\\n
getPreferredInstanceHostingResource()\n
\n
sale_packing_list_line_list = context.ERP5Site_getSlaveInstanceListFromComputerPartition(\n sale_packing_list_line_list = context.ERP5Site_getSlaveInstanceListFromComputerPartition(\n
software_instance.getRelativeUrl(),["%requested", "stopped"])\n software_instance.getRelativeUrl(), service_relative_url, ["%requested", "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
......
...@@ -51,8 +51,11 @@ ...@@ -51,8 +51,11 @@
<item> <item>
<key> <string>_body</string> </key> <key> <string>_body</string> </key>
<value> <string>software_instance = state_change["object"]\n <value> <string>software_instance = state_change["object"]\n
service_relative_url = software_instance.portal_preferences.\\\n
getPreferredInstanceHostingResource()\n
\n
sale_packing_list_line_list = context.ERP5Site_getSlaveInstanceListFromComputerPartition(\n sale_packing_list_line_list = context.ERP5Site_getSlaveInstanceListFromComputerPartition(\n
software_instance.getRelativeUrl(),["%requested", "started"])\n software_instance.getRelativeUrl(), service_relative_url, ["%requested", "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
......
...@@ -51,8 +51,11 @@ ...@@ -51,8 +51,11 @@
<item> <item>
<key> <string>_body</string> </key> <key> <string>_body</string> </key>
<value> <string>software_instance = state_change["object"]\n <value> <string>software_instance = state_change["object"]\n
service_relative_url = software_instance.portal_preferences.\\\n
getPreferredInstanceSetupResource()\n
\n
sale_packing_list_line_list = context.ERP5Site_getSlaveInstanceListFromComputerPartition(\n sale_packing_list_line_list = context.ERP5Site_getSlaveInstanceListFromComputerPartition(\n
software_instance.getRelativeUrl(),["%requested", "stopped"])\n software_instance.getRelativeUrl(), service_relative_url, ["%requested", "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
......
...@@ -51,8 +51,11 @@ ...@@ -51,8 +51,11 @@
<item> <item>
<key> <string>_body</string> </key> <key> <string>_body</string> </key>
<value> <string>software_instance = state_change["object"]\n <value> <string>software_instance = state_change["object"]\n
service_relative_url = software_instance.portal_preferences.\\\n
getPreferredInstanceHostingResource()\n
\n
sale_packing_list_line_list = context.ERP5Site_getSlaveInstanceListFromComputerPartition(\n sale_packing_list_line_list = context.ERP5Site_getSlaveInstanceListFromComputerPartition(\n
software_instance.getRelativeUrl(),["%requested", "stopped"])\n software_instance.getRelativeUrl(), service_relative_url, ["%requested", "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
......
...@@ -51,8 +51,10 @@ ...@@ -51,8 +51,10 @@
<item> <item>
<key> <string>_body</string> </key> <key> <string>_body</string> </key>
<value> <string>software_instance = state_change["object"]\n <value> <string>software_instance = state_change["object"]\n
service_relative_url = software_instance.portal_preferences.\\\n
getPreferredInstanceSetupResource()\n
sale_packing_list_line_list = context.ERP5Site_getSlaveInstanceListFromComputerPartition(\n sale_packing_list_line_list = context.ERP5Site_getSlaveInstanceListFromComputerPartition(\n
software_instance.getRelativeUrl(),["%requested", "started"])\n software_instance.getRelativeUrl(), service_relative_url, ["%requested", "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
......
...@@ -51,8 +51,11 @@ ...@@ -51,8 +51,11 @@
<item> <item>
<key> <string>_body</string> </key> <key> <string>_body</string> </key>
<value> <string>software_instance = state_change["object"]\n <value> <string>software_instance = state_change["object"]\n
service_relative_url = software_instance.portal_preferences.\\\n
getPreferredInstanceHostingResource()\n
\n
sale_packing_list_line_list = context.ERP5Site_getSlaveInstanceListFromComputerPartition(\n sale_packing_list_line_list = context.ERP5Site_getSlaveInstanceListFromComputerPartition(\n
software_instance.getRelativeUrl(),["%requested", "started"])\n software_instance.getRelativeUrl(), service_relative_url, ["%requested", "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
......
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