From ce2b29433da6db631c1f58be03cc8af52c01732f Mon Sep 17 00:00:00 2001 From: Lance Edgar Date: Tue, 24 Feb 2015 18:57:07 -0600 Subject: [PATCH] Exclude 'deleted' items from reports. --- tailbone/views/reports.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tailbone/views/reports.py b/tailbone/views/reports.py index 2cb2ae88..377251c5 100644 --- a/tailbone/views/reports.py +++ b/tailbone/views/reports.py @@ -95,6 +95,7 @@ class OrderingWorksheet(View): q = Session.query(model.ProductCost) q = q.join(model.Product) + q = q.filter(model.Product.deleted == False) q = q.filter(model.ProductCost.vendor == vendor) q = q.filter(model.Product.department_uuid.in_([x.uuid for x in departments])) if preferred_only: @@ -168,6 +169,7 @@ class InventoryWorksheet(View): def get_products(subdepartment): q = Session.query(model.Product) q = q.outerjoin(model.Brand) + q = q.filter(model.Product.deleted == False) q = q.filter(model.Product.subdepartment == subdepartment) if self.request.params.get('weighted-only'): q = q.filter(model.Product.unit_of_measure == enum.UNIT_OF_MEASURE_POUND)