Exclude 'deleted' items from reports.
This commit is contained in:
parent
50430e89db
commit
ce2b29433d
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue