Skip to content

Commit

Permalink
acquisitions: sort lines in order
Browse files Browse the repository at this point in the history
Line sorting is now done on the PID to keep the same order as the command.

* Closes #2653.

Co-Authored-by: Bertrand Zuchuat <[email protected]>
  • Loading branch information
Garfield-fr committed Sep 20, 2023
1 parent 770dc5e commit e7e2f87
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions rero_ils/modules/acquisition/acq_orders/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -357,9 +357,14 @@ def get_order_lines(self, output=None, includes=None):
if output == 'count':
return query.count()
elif output == 'query':
return query
return query \
.params(preserve_order=True) \
.sort({'pid': {"order": "asc"}})
else:
return get_objects(AcqOrderLine, query)
return get_objects(AcqOrderLine, query
.params(preserve_order=True)
.sort({'pid': {"order": "asc"}})
)

def get_order_provisional_total_amount(self):
"""Get provisional total amount of this order."""
Expand Down

0 comments on commit e7e2f87

Please sign in to comment.