From 240ecf3fbb94aa143a2242ae4b2d6e7c988daf9d Mon Sep 17 00:00:00 2001 From: tanshu Date: Wed, 10 Nov 2021 21:41:12 +0530 Subject: [PATCH] Fix: Checking the wrong id --- brewman/brewman/routers/reports/non_contract_purchase.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/brewman/brewman/routers/reports/non_contract_purchase.py b/brewman/brewman/routers/reports/non_contract_purchase.py index d1075ae5..54a29c16 100644 --- a/brewman/brewman/routers/reports/non_contract_purchase.py +++ b/brewman/brewman/routers/reports/non_contract_purchase.py @@ -68,7 +68,7 @@ def report(db: Session) -> List[schemas.NonContractPurchase]: p, u = db.execute( select(Product.name, StockKeepingUnit.units) .join(Product.skus) - .where(StockKeepingUnit.product_id == item.sku_id) + .where(StockKeepingUnit.id == item.sku_id) ).one() list_.append( schemas.NonContractPurchase(