Changeset - a72fd9ef7710
[Not reviewed]
0 1 0
Lance Edgar - 4 years ago 2021-02-09 16:12:32
lance@edbob.org
Use `sku` instead of `upc` when fetching CORE `vendorItems` record

since that is what API client now expects
1 file changed with 6 insertions and 5 deletions:
0 comments (0 inline, 0 general) First comment
rattail_corepos/datasync/rattail.py
Show inline comments
 
@@ -129,9 +129,9 @@ class FromCOREAPIToRattail(NewDataSyncImportConsumer):
 
        if change.payload_type == 'VendorItem':
 
            fields = change.payload_key.split('|')
 
            if len(fields) == 2:
 
                upc, vendorID = fields
 
                sku, vendorID = fields
 
                if vendorID.isdigit():
 
                    return self.api.get_vendor_item(upc, int(vendorID))
 
                    return self.api.get_vendor_item(sku, int(vendorID))
 

	
 
    def get_product(self, change):
 
        if change.payload_type == 'Product':
 
@@ -139,9 +139,10 @@ class FromCOREAPIToRattail(NewDataSyncImportConsumer):
 
        if change.payload_type == 'VendorItem':
 
            fields = change.payload_key.split('|')
 
            if len(fields) == 2:
 
                upc, vendorID = fields
 
                if upc:
 
                    return self.api.get_product(upc)
 
                sku, vendorID = fields
 
                vendor_item = self.api.get_vendor_item(sku, vendorID)
 
                if vendor_item:
 
                    return self.api.get_product(vendor_item['upc'])
 

	
 

	
 
class FromCOREPOSToRattailBase(NewDataSyncImportConsumer):
0 comments (0 inline, 0 general) First comment
You need to be logged in to comment. Login now