diff --git a/tailbone/views/batch/pricing.py b/tailbone/views/batch/pricing.py index be870fbc..996cbb2b 100644 --- a/tailbone/views/batch/pricing.py +++ b/tailbone/views/batch/pricing.py @@ -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)