diff --git a/tailbone_corepos/views/corepos/products.py b/tailbone_corepos/views/corepos/products.py index 4428f66..6c53e21 100644 --- a/tailbone_corepos/views/corepos/products.py +++ b/tailbone_corepos/views/corepos/products.py @@ -141,6 +141,21 @@ class ProductView(CoreOfficeMasterView): return '{}/item/ItemEditorPage.php?searchupc={}'.format( 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): """