From 426ba0ea344aa0bb352648e0f9117eed0a02f117 Mon Sep 17 00:00:00 2001 From: Lance Edgar Date: Thu, 11 Nov 2021 17:42:59 -0600 Subject: [PATCH] Fix "download results" support for Products it is not enabled by default, but still should work when it is --- tailbone/templates/products/index.mako | 1 + tailbone/views/products.py | 10 ++++++++++ 2 files changed, 11 insertions(+) diff --git a/tailbone/templates/products/index.mako b/tailbone/templates/products/index.mako index 06b1e7e0..3f65cd68 100644 --- a/tailbone/templates/products/index.mako +++ b/tailbone/templates/products/index.mako @@ -76,6 +76,7 @@ <%def name="grid_tools()"> + ${parent.grid_tools()} % if label_profiles and request.has_perm('products.print_labels'): diff --git a/tailbone/views/products.py b/tailbone/views/products.py index 351dd832..2f7bf02d 100644 --- a/tailbone/views/products.py +++ b/tailbone/views/products.py @@ -732,6 +732,16 @@ class ProductView(MasterView): return row + def download_results_normalize(self, product, fields, **kwargs): + data = super(ProductView, self).download_results_normalize( + product, fields, **kwargs) + + if 'upc' in data: + if isinstance(data['upc'], GPC): + data['upc'] = six.text_type(data['upc']) + + return data + def get_instance(self): key = self.request.matchdict['uuid'] product = Session.query(model.Product).get(key)