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