From e06c8b484e16f1ab7197801d5ea212f4f2fa6d59 Mon Sep 17 00:00:00 2001 From: tanshu Date: Tue, 2 Nov 2021 12:31:12 +0530 Subject: [PATCH] Change the default sort in Closing Stock --- brewman/brewman/routers/reports/closing_stock.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/brewman/brewman/routers/reports/closing_stock.py b/brewman/brewman/routers/reports/closing_stock.py index 2bb95f39..a0a2efec 100644 --- a/brewman/brewman/routers/reports/closing_stock.py +++ b/brewman/brewman/routers/reports/closing_stock.py @@ -154,7 +154,7 @@ def build_report(date_: date, cost_centre_id: uuid.UUID, db: Session) -> List[sc or_(Voucher.voucher_type != VoucherType.CLOSING_STOCK, Voucher.date != date_), ) .group_by(StockKeepingUnit, Product, ProductGroup) - .order_by(amount_sum.desc()) + .order_by(ProductGroup.name, Product.name, StockKeepingUnit.units) ).all() physical_list = (