Commit c51f75ef authored by Gabriel Monnerat's avatar Gabriel Monnerat

create script to remove the code duplicated

parent 1a9c7015
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>Script_magic</string> </key>
<value> <int>3</int> </value>
</item>
<item>
<key> <string>_bind_names</string> </key>
<value>
<object>
<klass>
<global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key> <string>_asgns</string> </key>
<value>
<dictionary>
<item>
<key> <string>name_container</string> </key>
<value> <string>container</string> </value>
</item>
<item>
<key> <string>name_context</string> </key>
<value> <string>context</string> </value>
</item>
<item>
<key> <string>name_m_self</string> </key>
<value> <string>script</string> </value>
</item>
<item>
<key> <string>name_subpath</string> </key>
<value> <string>traverse_subpath</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>_body</string> </key>
<value> <string>from Products.ZSQLCatalog.SQLCatalog import Query, ComplexQuery\n
portal = context.getPortalObject()\n
\n
sale_packing_list_line = portal.portal_catalog.getResultValue(\n
portal_type="Sale Packing List Line",\n
aggregate_relative_url=relative_url)\n
computer_partition = sale_packing_list_line.getAggregateValue(portal_type="Computer Partition")\n
\n
slave_instance_query = ComplexQuery(\n
Query(aggregate_portal_type="Slave Instance"),\n
Query(aggregate_validation_state=state_list),\n
operator="AND")\n
\n
computer_partition_query = Query(aggregate_relative_url=computer_partition.getRelativeUrl())\n
query = ComplexQuery(computer_partition_query, slave_instance_query, operator="AND")\n
\n
return portal.portal_catalog(portal_type=\'Sale Packing List Line\', query=query)\n
</string> </value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>relative_url, state_list</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>ERP5Site_getSlaveInstanceListFromComputerPartition</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -50,24 +50,9 @@
</item>
<item>
<key> <string>_body</string> </key>
<value> <string>from Products.ZSQLCatalog.SQLCatalog import Query, ComplexQuery\n
portal = context.getPortalObject()\n
\n
software_instance = state_change["object"]\n
sale_packing_list_line = portal.portal_catalog.getResultValue(\n
portal_type="Sale Packing List Line",\n
aggregate_relative_url=software_instance.getRelativeUrl())\n
computer_partition = sale_packing_list_line.getAggregateValue(portal_type="Computer Partition")\n
\n
slave_instance_query = ComplexQuery(\n
Query(aggregate_portal_type="Slave Instance"),\n
Query(aggregate_validation_state=["%requested", "stopped"]),\n
operator="AND")\n
computer_partition_query = Query(aggregate_relative_url=computer_partition.getRelativeUrl())\n
query = ComplexQuery(computer_partition_query, slave_instance_query, operator="AND")\n
\n
sale_packing_list_line_list = portal.portal_catalog(\n
portal_type=\'Sale Packing List Line\', query=query)\n
<value> <string>software_instance = state_change["object"]\n
sale_packing_list_line_list = context.ERP5Site_getSlaveInstanceListFromComputerPartition(\n
software_instance.getRelativeUrl(),["%requested", "stopped"])\n
\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
......
......@@ -50,24 +50,9 @@
</item>
<item>
<key> <string>_body</string> </key>
<value> <string>from Products.ZSQLCatalog.SQLCatalog import Query, ComplexQuery\n
portal = context.getPortalObject()\n
\n
software_instance = state_change["object"]\n
sale_packing_list_line = portal.portal_catalog.getResultValue(\n
portal_type="Sale Packing List Line",\n
aggregate_relative_url=software_instance.getRelativeUrl())\n
computer_partition = sale_packing_list_line.getAggregateValue(portal_type="Computer Partition")\n
\n
slave_instance_query = ComplexQuery(\n
Query(aggregate_portal_type="Slave Instance"),\n
Query(aggregate_validation_state=["%requested", "started"]),\n
operator="AND")\n
computer_partition_query = Query(aggregate_relative_url=computer_partition.getRelativeUrl())\n
query = ComplexQuery(computer_partition_query, slave_instance_query, operator="AND")\n
\n
sale_packing_list_line_list = portal.portal_catalog(\n
portal_type=\'Sale Packing List Line\', query=query)\n
<value> <string>software_instance = state_change["object"]\n
sale_packing_list_line_list = context.ERP5Site_getSlaveInstanceListFromComputerPartition(\n
software_instance.getRelativeUrl(),["%requested", "started"])\n
\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
......
399
\ No newline at end of file
400
\ 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