Commit ad5ab9b1 authored by Romain Courteaud's avatar Romain Courteaud

slapos_accounting: workaround wrong select returning a result multiple times

parent 14c3b075
...@@ -34,6 +34,10 @@ select_kw.update( ...@@ -34,6 +34,10 @@ select_kw.update(
default_aggregate_portal_type=ComplexQuery(NegatedQuery(Query(default_aggregate_portal_type='Compute Node')), default_aggregate_portal_type=ComplexQuery(NegatedQuery(Query(default_aggregate_portal_type='Compute Node')),
Query(default_aggregate_portal_type=None),logical_operator="OR"), Query(default_aggregate_portal_type=None),logical_operator="OR"),
grouping_reference=None, grouping_reference=None,
# XXX SELECT DISTINCT uses default_aggregate_portal_type as parameter
# leading to return movement with 2 aggregate values twice
# Use group_by to workaround the issue
group_by_list=['uid'],
sort_on=(('modification_date', 'ASC'),) # the highest chance to find movement which can be delivered sort_on=(('modification_date', 'ASC'),) # the highest chance to find movement which can be delivered
) )
movement_list = portal.portal_catalog(**select_kw) movement_list = portal.portal_catalog(**select_kw)
......
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