Add 'unit_cost' to Excel download for Products grid
This commit is contained in:
		
							parent
							
								
									c7496d7018
								
							
						
					
					
						commit
						8d534691ac
					
				
					 1 changed files with 5 additions and 0 deletions
				
			
		|  | @ -518,6 +518,8 @@ class ProductsView(MasterView): | |||
|         i = fields.index('current_price_uuid') | ||||
|         fields.insert(i + 1, 'current_price') | ||||
| 
 | ||||
|         fields.append('unit_cost') | ||||
| 
 | ||||
|         return fields | ||||
| 
 | ||||
|     def get_xlsx_row(self, product, fields): | ||||
|  | @ -563,6 +565,9 @@ class ProductsView(MasterView): | |||
|         if 'current_price' in fields: | ||||
|             row['current_price'] = product.current_price.price if product.current_price else None | ||||
| 
 | ||||
|         if 'unit_cost' in fields: | ||||
|             row['unit_cost'] = product.cost.unit_cost if product.cost else None | ||||
| 
 | ||||
|         return row | ||||
| 
 | ||||
|     def get_instance(self): | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Lance Edgar
						Lance Edgar