From 396b123e1a393fc0d3cb39d7abbc577427149577 Mon Sep 17 00:00:00 2001 From: Lance Edgar Date: Sun, 5 Dec 2021 17:26:23 -0600 Subject: [PATCH] Tweak exposure for some fields --- tailbone_corepos/views/corepos/batches.py | 8 ++++++-- tailbone_corepos/views/corepos/products.py | 1 + 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/tailbone_corepos/views/corepos/batches.py b/tailbone_corepos/views/corepos/batches.py index a43e126..2708199 100644 --- a/tailbone_corepos/views/corepos/batches.py +++ b/tailbone_corepos/views/corepos/batches.py @@ -2,7 +2,7 @@ ################################################################################ # # Rattail -- Retail Software Framework -# Copyright © 2010-2020 Lance Edgar +# Copyright © 2010-2021 Lance Edgar # # This file is part of Rattail. # @@ -143,7 +143,11 @@ class BatchView(CoreOfficeMasterView): g.set_type('sale_price', 'currency') g.set_type('group_sale_price', 'currency') - g.set_type('cost', 'currency') + # TODO: some older installs don't have this field + if hasattr(corepos.BatchItem, 'cost'): + g.set_type('cost', 'currency') + else: + g.remove('cost') g.set_sort_defaults('id') diff --git a/tailbone_corepos/views/corepos/products.py b/tailbone_corepos/views/corepos/products.py index 39f372b..518f15b 100644 --- a/tailbone_corepos/views/corepos/products.py +++ b/tailbone_corepos/views/corepos/products.py @@ -352,6 +352,7 @@ class ProductUserView(CoreOfficeMasterView): 'photo', 'enable_online', 'sold_out', + 'sign_count', ] def configure_grid(self, g):