Add Family and Product.family to the general grid/crud UI.

This commit is contained in:
Lance Edgar 2014-04-13 00:04:30 -07:00
parent e4ef46d4fc
commit 087342b09c
5 changed files with 141 additions and 0 deletions

View file

@ -42,6 +42,7 @@ from rattail import sil
from rattail import batches
from rattail.threads import Thread
from rattail.exceptions import LabelPrintingError
from rattail.db import model
from rattail.db.model import (
Product, ProductPrice, ProductCost, ProductCode,
Brand, Vendor, Department, Subdepartment, LabelProfile)
@ -90,6 +91,8 @@ class ProductsGrid(SearchableAlchemyGridView):
return {
'brand':
lambda q: q.outerjoin(Brand),
'family':
lambda q: q.outerjoin(model.Family),
'department':
lambda q: q.outerjoin(Department,
Department.uuid == Product.department_uuid),
@ -138,6 +141,7 @@ class ProductsGrid(SearchableAlchemyGridView):
ilike=['description', 'size'],
upc=filter_upc(),
brand=self.filter_ilike(Brand.name),
family=self.filter_ilike(model.Family.name),
department=self.filter_ilike(Department.name),
subdepartment=self.filter_ilike(Subdepartment.name),
vendor=self.filter_ilike(Vendor.name),