Don't add values to CSV row for undefined fields
This commit is contained in:
parent
de6275003e
commit
fded97d586
|
@ -184,8 +184,11 @@ class PricingBatchView(BatchMasterView):
|
|||
csvrow = super(PricingBatchView, self).get_row_csv_row(row, fields)
|
||||
|
||||
vendor = row.vendor
|
||||
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
|
||||
|
|
Loading…
Reference in a new issue