diff --git a/tailbone/views/batch/pricing.py b/tailbone/views/batch/pricing.py index e569a001..f5c29c31 100644 --- a/tailbone/views/batch/pricing.py +++ b/tailbone/views/batch/pricing.py @@ -184,9 +184,12 @@ class PricingBatchView(BatchMasterView): csvrow = super(PricingBatchView, self).get_row_csv_row(row, fields) vendor = row.vendor - csvrow['vendor_id'] = vendor.id if vendor else None - csvrow['vendor_abbreviation'] = vendor.abbreviation if vendor else None - csvrow['vendor_name'] = vendor.name if vendor else None + if 'vendor_id' in fields: + csvrow['vendor_id'] = vendor.id if vendor else None + if 'vendor_abbreviation' in fields: + csvrow['vendor_abbreviation'] = vendor.abbreviation if vendor else None + if 'vendor_name' in fields: + csvrow['vendor_name'] = vendor.name if vendor else None return csvrow