Exclude 'deleted' items from reports.

This commit is contained in:
Lance Edgar 2015-02-24 18:57:07 -06:00
parent 50430e89db
commit ce2b29433d

View file

@ -95,6 +95,7 @@ class OrderingWorksheet(View):
q = Session.query(model.ProductCost) q = Session.query(model.ProductCost)
q = q.join(model.Product) q = q.join(model.Product)
q = q.filter(model.Product.deleted == False)
q = q.filter(model.ProductCost.vendor == vendor) q = q.filter(model.ProductCost.vendor == vendor)
q = q.filter(model.Product.department_uuid.in_([x.uuid for x in departments])) q = q.filter(model.Product.department_uuid.in_([x.uuid for x in departments]))
if preferred_only: if preferred_only:
@ -168,6 +169,7 @@ class InventoryWorksheet(View):
def get_products(subdepartment): def get_products(subdepartment):
q = Session.query(model.Product) q = Session.query(model.Product)
q = q.outerjoin(model.Brand) q = q.outerjoin(model.Brand)
q = q.filter(model.Product.deleted == False)
q = q.filter(model.Product.subdepartment == subdepartment) q = q.filter(model.Product.subdepartment == subdepartment)
if self.request.params.get('weighted-only'): if self.request.params.get('weighted-only'):
q = q.filter(model.Product.unit_of_measure == enum.UNIT_OF_MEASURE_POUND) q = q.filter(model.Product.unit_of_measure == enum.UNIT_OF_MEASURE_POUND)