fix UPC search in products screen

This commit is contained in:
Lance Edgar 2012-11-14 13:31:25 -08:00
parent 352f32ff5e
commit c76e3242fc

View file

@ -97,7 +97,7 @@ class ProductsGrid(SearchableAlchemyGridView):
except ValueError: except ValueError:
return q return q
else: else:
return q.filter(field == v) if v else q return q.filter(rattail.Product.upc == v) if v else q
def filter_not(q, v): def filter_not(q, v):
try: try:
@ -105,7 +105,7 @@ class ProductsGrid(SearchableAlchemyGridView):
except ValueError: except ValueError:
return q return q
else: else:
return q.filter(field != v) if v else q return q.filter(rattail.Product.upc != v) if v else q
return {'is': filter_is, 'nt': filter_not} return {'is': filter_is, 'nt': filter_not}