From a49aa77ec0ba1e9f906d9b2114b055d207aa2283 Mon Sep 17 00:00:00 2001 From: Lance Edgar Date: Tue, 3 May 2022 13:36:14 -0500 Subject: [PATCH] Tweak how family data is displayed --- tailbone/views/families.py | 12 +++++------- tailbone/views/master.py | 4 +++- tailbone/views/products.py | 2 +- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/tailbone/views/families.py b/tailbone/views/families.py index b2a5ebe3..1190ad06 100644 --- a/tailbone/views/families.py +++ b/tailbone/views/families.py @@ -2,7 +2,7 @@ ################################################################################ # # Rattail -- Retail Software Framework -# Copyright © 2010-2021 Lance Edgar +# Copyright © 2010-2022 Lance Edgar # # This file is part of Rattail. # @@ -54,12 +54,8 @@ class FamilyView(MasterView): has_rows = True model_row_class = model.Product - row_labels = { - 'upc': "UPC", - } - row_grid_columns = [ - 'upc', + '_product_key_', 'brand', 'description', 'size', @@ -94,7 +90,9 @@ class FamilyView(MasterView): g.set_renderer('regular_price', self.render_price) g.set_renderer('current_price', self.render_price) - g.set_sort_defaults('upc') + key = self.rattail_config.product_key() + field = self.product_key_fields.get(key, key) + g.set_sort_defaults(field) def render_price(self, product, field): if not product.not_for_sale: diff --git a/tailbone/views/master.py b/tailbone/views/master.py index c3b9d4c1..83f77b69 100644 --- a/tailbone/views/master.py +++ b/tailbone/views/master.py @@ -180,7 +180,9 @@ class MasterView(View): rows_downloadable_csv = False rows_downloadable_xlsx = False - row_labels = {} + row_labels = { + 'upc': "UPC", + } @property def Session(self): diff --git a/tailbone/views/products.py b/tailbone/views/products.py index 145f55cb..a5706a25 100644 --- a/tailbone/views/products.py +++ b/tailbone/views/products.py @@ -900,7 +900,7 @@ class ProductView(MasterView): f.set_label('family_uuid', "Family") else: f.set_readonly('family') - # f.set_renderer('family', self.render_family) + f.set_renderer('family', self.render_family) # report_code if self.creating or self.editing: