Populate Vendor.id when importing from CORE API

This commit is contained in:
Lance Edgar 2021-01-27 22:21:31 -06:00
parent 95952c665e
commit ef68d4b2d0

View file

@ -429,6 +429,7 @@ class VendorImporter(FromCOREPOSAPI, corepos_importing.model.VendorImporter):
key = 'corepos_id' key = 'corepos_id'
supported_fields = [ supported_fields = [
'corepos_id', 'corepos_id',
'id',
'name', 'name',
'abbreviation', 'abbreviation',
'special_discount', 'special_discount',
@ -443,6 +444,7 @@ class VendorImporter(FromCOREPOSAPI, corepos_importing.model.VendorImporter):
def normalize_host_object(self, vendor): def normalize_host_object(self, vendor):
return { return {
'corepos_id': int(vendor['vendorID']), 'corepos_id': int(vendor['vendorID']),
'id': str(vendor['vendorID']),
'name': vendor['vendorName'], 'name': vendor['vendorName'],
'abbreviation': vendor.get('vendorAbbreviation') or None, 'abbreviation': vendor.get('vendorAbbreviation') or None,
'special_discount': decimal.Decimal(vendor['discountRate']), 'special_discount': decimal.Decimal(vendor['discountRate']),