From ef68d4b2d09ddbcdbd40950afec493508c230db3 Mon Sep 17 00:00:00 2001 From: Lance Edgar Date: Wed, 27 Jan 2021 22:21:31 -0600 Subject: [PATCH] Populate `Vendor.id` when importing from CORE API --- rattail_corepos/importing/corepos/api.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/rattail_corepos/importing/corepos/api.py b/rattail_corepos/importing/corepos/api.py index deff510..a2024df 100644 --- a/rattail_corepos/importing/corepos/api.py +++ b/rattail_corepos/importing/corepos/api.py @@ -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']),