Fix "download results" support for Products

it is not enabled by default, but still should work when it is
This commit is contained in:
Lance Edgar 2021-11-11 17:42:59 -06:00
parent 3a10a4bcb7
commit 426ba0ea34
2 changed files with 11 additions and 0 deletions

View file

@ -76,6 +76,7 @@
</%def>
<%def name="grid_tools()">
${parent.grid_tools()}
% if label_profiles and request.has_perm('products.print_labels'):
<table class="label-printing">
<thead>

View file

@ -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)