Commit 02d06501 authored by Romain Courteaud's avatar Romain Courteaud

Support multiple open order line with the same effective_date.

If 2 lines have the same effective date (catalog has a 1 second precision),
always return the validate and open first.
parent a8430cfd
......@@ -119,7 +119,9 @@ class SubscriptionItem(Item, CompositionMixin, MovementGeneratorMixin,
for movement in catalog_tool(portal_type="Open Sale Order Line",
default_aggregate_uid=self.getUid(),
validation_state=('open', 'validated', 'archived'), # XXX-JPS hard coding
sort_on=(('effective_date', 'descending'),),
sort_on=(('effective_date', 'descending'),
# Do not return archived if effective dates are identical
('validation_state', 'descending')),
limit=1 # Note Luke: Support the newest Open Order which defines
# something for current subscription item
): # YXU-Why we have a list here?
......
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