Fix vendor ID/name for Excel download of pricing batch rows
This commit is contained in:
		
							parent
							
								
									b875540397
								
							
						
					
					
						commit
						132b2b9ec7
					
				
					 1 changed files with 15 additions and 0 deletions
				
			
		|  | @ -261,6 +261,7 @@ class PricingBatchView(BatchMasterView): | |||
| 
 | ||||
|         return fields | ||||
| 
 | ||||
|     # TODO: this is the same as xlsx row! should merge/share somehow? | ||||
|     def get_row_csv_row(self, row, fields): | ||||
|         csvrow = super(PricingBatchView, self).get_row_csv_row(row, fields) | ||||
| 
 | ||||
|  | @ -274,6 +275,20 @@ class PricingBatchView(BatchMasterView): | |||
| 
 | ||||
|         return csvrow | ||||
| 
 | ||||
|     # TODO: this is the same as csv row! should merge/share somehow? | ||||
|     def get_row_xlsx_row(self, row, fields): | ||||
|         xlrow = super(PricingBatchView, self).get_row_xlsx_row(row, fields) | ||||
| 
 | ||||
|         vendor = row.vendor | ||||
|         if 'vendor_id' in fields: | ||||
|             xlrow['vendor_id'] = (vendor.id or '') if vendor else '' | ||||
|         if 'vendor_abbreviation' in fields: | ||||
|             xlrow['vendor_abbreviation'] = (vendor.abbreviation or '') if vendor else '' | ||||
|         if 'vendor_name' in fields: | ||||
|             xlrow['vendor_name'] = (vendor.name or '') if vendor else '' | ||||
| 
 | ||||
|         return xlrow | ||||
| 
 | ||||
| 
 | ||||
| def includeme(config): | ||||
|     PricingBatchView.defaults(config) | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Lance Edgar
						Lance Edgar