Fix "download results" support for Products
it is not enabled by default, but still should work when it is
This commit is contained in:
parent
3a10a4bcb7
commit
426ba0ea34
|
@ -76,6 +76,7 @@
|
||||||
</%def>
|
</%def>
|
||||||
|
|
||||||
<%def name="grid_tools()">
|
<%def name="grid_tools()">
|
||||||
|
${parent.grid_tools()}
|
||||||
% if label_profiles and request.has_perm('products.print_labels'):
|
% if label_profiles and request.has_perm('products.print_labels'):
|
||||||
<table class="label-printing">
|
<table class="label-printing">
|
||||||
<thead>
|
<thead>
|
||||||
|
|
|
@ -732,6 +732,16 @@ class ProductView(MasterView):
|
||||||
|
|
||||||
return row
|
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):
|
def get_instance(self):
|
||||||
key = self.request.matchdict['uuid']
|
key = self.request.matchdict['uuid']
|
||||||
product = Session.query(model.Product).get(key)
|
product = Session.query(model.Product).get(key)
|
||||||
|
|
Loading…
Reference in a new issue