Highlight "has inventory" rows for delete item batch
also pass list of such rows to template context
This commit is contained in:
		
							parent
							
								
									60fe7cf29c
								
							
						
					
					
						commit
						661d536e9d
					
				
					 1 changed files with 10 additions and 0 deletions
				
			
		|  | @ -88,10 +88,20 @@ class DeleteProductBatchView(BatchMasterView): | |||
|         'status_text', | ||||
|     ] | ||||
| 
 | ||||
|     def template_kwargs_view(self, **kwargs): | ||||
|         kwargs = super(DeleteProductBatchView, self).template_kwargs_view(**kwargs) | ||||
|         batch = kwargs['batch'] | ||||
| 
 | ||||
|         kwargs['rows_with_inventory'] = [row for row in batch.active_rows() | ||||
|                                          if row.status_code == row.STATUS_HAS_INVENTORY] | ||||
| 
 | ||||
|         return kwargs | ||||
| 
 | ||||
|     def row_grid_extra_class(self, row, i): | ||||
|         if row.status_code == row.STATUS_PRODUCT_NOT_FOUND: | ||||
|             return 'warning' | ||||
|         if row.status_code in (row.STATUS_DELETE_NOT_ALLOWED, | ||||
|                                row.STATUS_HAS_INVENTORY, | ||||
|                                row.STATUS_PENDING_CUSTOMER_ORDERS): | ||||
|             return 'notice' | ||||
| 
 | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Lance Edgar
						Lance Edgar