Hide "print labels" column on products list view if so configured.
This commit is contained in:
parent
f34ae88c39
commit
62a93d1cd1
|
@ -206,11 +206,13 @@ class ProductsGrid(SearchableAlchemyGridView):
|
||||||
g.deletable = True
|
g.deletable = True
|
||||||
g.delete_route_name = 'product.delete'
|
g.delete_route_name = 'product.delete'
|
||||||
|
|
||||||
q = Session.query(LabelProfile)
|
# Maybe add Print Label column.
|
||||||
if q.count():
|
if self.request.rattail_config.getboolean('tailbone', 'products.print_labels', default=True):
|
||||||
def labels(row):
|
q = Session.query(LabelProfile)
|
||||||
return link_to("Print", '#', class_='print-label')
|
if q.count():
|
||||||
g.add_column('labels', "Labels", labels)
|
def labels(row):
|
||||||
|
return link_to("Print", '#', class_='print-label')
|
||||||
|
g.add_column('labels', "Labels", labels)
|
||||||
|
|
||||||
return g
|
return g
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue