Changeset - ef68d4b2d09d
[Not reviewed]
0 1 0
Lance Edgar - 4 years ago 2021-01-27 22:21:31
lance@edbob.org
Populate `Vendor.id` when importing from CORE API
1 file changed with 2 insertions and 0 deletions:
0 comments (0 inline, 0 general) First comment
rattail_corepos/importing/corepos/api.py
Show inline comments
 
@@ -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']),
0 comments (0 inline, 0 general) First comment
You need to be logged in to comment. Login now