From 86a42064ea9dd7957e605406a8c84e39be1d6f97 Mon Sep 17 00:00:00 2001 From: Lance Edgar Date: Fri, 11 Feb 2022 15:35:12 -0600 Subject: [PATCH] Cleanup labels for Vendor/Code "preferred" vs. "any" in products grid --- tailbone/views/products.py | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/tailbone/views/products.py b/tailbone/views/products.py index 752a996d..33615ef4 100644 --- a/tailbone/views/products.py +++ b/tailbone/views/products.py @@ -283,8 +283,6 @@ class ProductView(MasterView): g.joiners['code'] = lambda q: q.outerjoin(model.ProductCode) g.joiners['vendor'] = join_vendor g.joiners['vendor_any'] = join_vendor_any - g.joiners['vendor_code'] = join_vendor_code - g.joiners['vendor_code_any'] = join_vendor_code_any g.sorters['brand'] = g.make_sorter(model.Brand.name) g.sorters['subdepartment'] = g.make_sorter(model.Subdepartment.name) @@ -322,8 +320,19 @@ class ProductView(MasterView): g.filters['vendor'] = g.make_filter('vendor', model.Vendor.name) g.filters['vendor_any'] = g.make_filter('vendor_any', self.VendorAny.name) # factory=VendorAnyFilter, joiner=join_vendor_any) - g.filters['vendor_code'] = g.make_filter('vendor_code', ProductCostCode.code) - g.filters['vendor_code_any'] = g.make_filter('vendor_code_any', ProductCostCodeAny.code) + + # g.joiners['vendor_code_any'] = join_vendor_code_any + # g.filters['vendor_code_any'] = g.make_filter('vendor_code_any', ProductCostCodeAny.code) + # g.joiners['vendor_code'] = join_vendor_code + # g.filters['vendor_code'] = g.make_filter('vendor_code', ProductCostCode.code) + + # vendor_code* + g.set_joiner('vendor_code', join_vendor_code) + g.set_filter('vendor_code', ProductCostCode.code) + g.set_label('vendor_code', "Vendor Code (preferred)") + g.set_joiner('vendor_code_any', join_vendor_code_any) + g.set_filter('vendor_code_any', ProductCostCodeAny.code) + g.set_label('vendor_code_any', "Vendor Code (any)") # category g.set_joiner('category', lambda q: q.outerjoin(model.Category)) @@ -390,7 +399,7 @@ class ProductView(MasterView): g.set_label('vendor', "Vendor (preferred)") g.set_label('vendor_any', "Vendor (any)") - g.set_label('vendor', "Pref. Vendor") + g.set_label('vendor', "Vendor (preferred)") def configure_common_form(self, f): super(ProductView, self).configure_common_form(f)