Commit 4a70672e authored by Gabriel Monnerat's avatar Gabriel Monnerat

After a Slave Instance is created, one Sale Packing List with resource ==...

After a Slave Instance is created, one Sale Packing List with resource == "vifib_instance_setup" and simulation_state == "confirmed" is created. With this cenario, is needed make mofications in the Software Installed installed. So, this changes is to request modifications in Software Instances after one Slave Instance is requested.
parent 9eedba99
......@@ -454,20 +454,31 @@ class SlapTool(BaseTool):
portal = self.getPortalObject()
portal_preferences = portal.portal_preferences
service = portal.restrictedTraverse(
hosting_service = portal.restrictedTraverse(
portal_preferences.getPreferredInstanceHostingResource())
query = ComplexQuery(Query(aggregate_portal_type="Slave Instance"),
Query(aggregate_relative_url=computer_partition_document.getRelativeUrl()),
operator="AND")
setup_service = portal.restrictedTraverse(
portal_preferences.getPreferredInstanceSetupResource())
slave_query = ComplexQuery(Query(aggregate_portal_type="Slave Instance"),
Query(aggregate_relative_url=computer_partition_document.getRelativeUrl()),
# Search only for Confirmed and Stopped, the only one states that require
# buildout be re-updated.
Query(simulation_state=["confirmed", "stopped"]),
Query(default_resource_uid=hosting_service.getUid()),
operator="AND")
setup_query = ComplexQuery(Query(aggregate_portal_type="Slave Instance"),
Query(aggregate_relative_url=computer_partition_document.getRelativeUrl()),
Query(simulation_state=["confirmed", "started"]),
Query(default_resource_uid=setup_service.getUid()),
operator="AND")
query = ComplexQuery(slave_query, setup_query, operator="OR")
# Use getTrackingList
catalog_result = portal.portal_catalog(
portal_type='Sale Packing List Line',
# Search only for Confirmed and Stopped, the only one states that require
# buildout be re-updated.
simulation_state= ["confirmed", 'stopped'],
default_resource_uid=service.getUid(),
sort_on=(('movement.start_date', 'DESC'),),
limit=1,
query=query)
......
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