Tweak how family data is displayed
This commit is contained in:
parent
129455a31f
commit
a49aa77ec0
|
@ -2,7 +2,7 @@
|
||||||
################################################################################
|
################################################################################
|
||||||
#
|
#
|
||||||
# Rattail -- Retail Software Framework
|
# Rattail -- Retail Software Framework
|
||||||
# Copyright © 2010-2021 Lance Edgar
|
# Copyright © 2010-2022 Lance Edgar
|
||||||
#
|
#
|
||||||
# This file is part of Rattail.
|
# This file is part of Rattail.
|
||||||
#
|
#
|
||||||
|
@ -54,12 +54,8 @@ class FamilyView(MasterView):
|
||||||
has_rows = True
|
has_rows = True
|
||||||
model_row_class = model.Product
|
model_row_class = model.Product
|
||||||
|
|
||||||
row_labels = {
|
|
||||||
'upc': "UPC",
|
|
||||||
}
|
|
||||||
|
|
||||||
row_grid_columns = [
|
row_grid_columns = [
|
||||||
'upc',
|
'_product_key_',
|
||||||
'brand',
|
'brand',
|
||||||
'description',
|
'description',
|
||||||
'size',
|
'size',
|
||||||
|
@ -94,7 +90,9 @@ class FamilyView(MasterView):
|
||||||
g.set_renderer('regular_price', self.render_price)
|
g.set_renderer('regular_price', self.render_price)
|
||||||
g.set_renderer('current_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):
|
def render_price(self, product, field):
|
||||||
if not product.not_for_sale:
|
if not product.not_for_sale:
|
||||||
|
|
|
@ -180,7 +180,9 @@ class MasterView(View):
|
||||||
rows_downloadable_csv = False
|
rows_downloadable_csv = False
|
||||||
rows_downloadable_xlsx = False
|
rows_downloadable_xlsx = False
|
||||||
|
|
||||||
row_labels = {}
|
row_labels = {
|
||||||
|
'upc': "UPC",
|
||||||
|
}
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def Session(self):
|
def Session(self):
|
||||||
|
|
|
@ -900,7 +900,7 @@ class ProductView(MasterView):
|
||||||
f.set_label('family_uuid', "Family")
|
f.set_label('family_uuid', "Family")
|
||||||
else:
|
else:
|
||||||
f.set_readonly('family')
|
f.set_readonly('family')
|
||||||
# f.set_renderer('family', self.render_family)
|
f.set_renderer('family', self.render_family)
|
||||||
|
|
||||||
# report_code
|
# report_code
|
||||||
if self.creating or self.editing:
|
if self.creating or self.editing:
|
||||||
|
|
Loading…
Reference in a new issue