diff --git a/erpnext/stock/stock_ledger.py b/erpnext/stock/stock_ledger.py index 03c04a54ad..b638f08ed9 100644 --- a/erpnext/stock/stock_ledger.py +++ b/erpnext/stock/stock_ledger.py @@ -1451,6 +1451,8 @@ def get_next_stock_reco(kwargs): ) ) ) + .orderby(CombineDatetime(sle.posting_date, sle.posting_time)) + .orderby(sle.creation) ) if kwargs.get("batch_no"):