Add product grid filters for "on hand", "on order"

This commit is contained in:
Lance Edgar 2018-07-13 20:17:22 -05:00
parent 935a6b2a68
commit 0e57152888

View file

@ -223,8 +223,14 @@ class ProductsView(MasterView):
g.sorters['department'] = g.make_sorter(model.Department.name) g.sorters['department'] = g.make_sorter(model.Department.name)
g.sorters['subdepartment'] = g.make_sorter(model.Subdepartment.name) g.sorters['subdepartment'] = g.make_sorter(model.Subdepartment.name)
g.sorters['vendor'] = g.make_sorter(model.Vendor.name) g.sorters['vendor'] = g.make_sorter(model.Vendor.name)
# on_hand
g.set_sorter('on_hand', model.ProductInventory.on_hand) g.set_sorter('on_hand', model.ProductInventory.on_hand)
g.set_filter('on_hand', model.ProductInventory.on_hand)
# on_order
g.set_sorter('on_order', model.ProductInventory.on_order) g.set_sorter('on_order', model.ProductInventory.on_order)
g.set_filter('on_order', model.ProductInventory.on_order)
g.filters['upc'].default_active = True g.filters['upc'].default_active = True
g.filters['upc'].default_verb = 'equal' g.filters['upc'].default_verb = 'equal'