Include "superdepartment_number" in Excel products download
This commit is contained in:
		
							parent
							
								
									56fd3a5a4b
								
							
						
					
					
						commit
						c5d119a542
					
				
					 1 changed files with 15 additions and 0 deletions
				
			
		| 
						 | 
					@ -141,6 +141,21 @@ class ProductView(CoreOfficeMasterView):
 | 
				
			||||||
        return '{}/item/ItemEditorPage.php?searchupc={}'.format(
 | 
					        return '{}/item/ItemEditorPage.php?searchupc={}'.format(
 | 
				
			||||||
            office_url, product.upc)
 | 
					            office_url, product.upc)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    def get_xlsx_fields(self):
 | 
				
			||||||
 | 
					        fields = super(ProductView, self).get_xlsx_fields()
 | 
				
			||||||
 | 
					        fields.append('superdepartment_number')
 | 
				
			||||||
 | 
					        return fields
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    def get_xlsx_row(self, product, fields):
 | 
				
			||||||
 | 
					        row = super(ProductView, self).get_xlsx_row(product, fields)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        row['superdepartment_number'] = None
 | 
				
			||||||
 | 
					        dept = product.department
 | 
				
			||||||
 | 
					        if dept and dept._super_parents:
 | 
				
			||||||
 | 
					            row['superdepartment_number'] = dept._super_parents[0].parent_id
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        return row
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
class ProductFlagView(CoreOfficeMasterView):
 | 
					class ProductFlagView(CoreOfficeMasterView):
 | 
				
			||||||
    """
 | 
					    """
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue