Commit e3c2f5ef authored by Rafael Monnerat's avatar Rafael Monnerat

slapos_accounting: Only launch activities for the objects that actually changed

This prevent launch activities for all objects in the list.
parent 1f18510b
portal = context.getPortalObject()
portal.portal_catalog.searchAndActivate(
# XXX Filter directly the right open sale order
method_id='OpenSaleOrder_reindexIfIndexedBeforeLine',
portal_type="Open Sale Order",
children_portal_type="Open Sale Order Line",
uid=[i.uid for i in portal.ERP5Site_zGetOpenOrderWithModifiedLineUid()],
activate_kw={'tag': tag},
)
......
SELECT
catalog.uid, catalog.path
FROM
catalog, catalog as open_sale_order_line_catalog
WHERE
1=1
AND catalog.path != 'reserved'
AND open_sale_order_line_catalog.path != 'reserved'
AND catalog.portal_type = "Open Sale Order"
AND catalog.uid = open_sale_order_line_catalog.parent_uid
AND open_sale_order_line_catalog.portal_type = "Open Sale Order Line"
AND open_sale_order_line_catalog.indexation_timestamp > catalog.indexation_timestamp
group by
catalog.uid
\ No newline at end of file
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="SQL" module="Products.ZSQLMethods.SQL"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_col</string> </key>
<value>
<list>
<dictionary>
<item>
<key> <string>name</string> </key>
<value> <string>uid</string> </value>
</item>
<item>
<key> <string>null</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>type</string> </key>
<value> <string>l</string> </value>
</item>
<item>
<key> <string>width</string> </key>
<value> <int>6</int> </value>
</item>
</dictionary>
<dictionary>
<item>
<key> <string>name</string> </key>
<value> <string>path</string> </value>
</item>
<item>
<key> <string>null</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>type</string> </key>
<value> <string>t</string> </value>
</item>
<item>
<key> <string>width</string> </key>
<value> <int>43</int> </value>
</item>
</dictionary>
</list>
</value>
</item>
<item>
<key> <string>arguments_src</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>connection_id</string> </key>
<value> <string>erp5_sql_connection</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>ERP5Site_zGetOpenOrderWithModifiedLineUid</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
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