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