From a72fd9ef77108845b6a41dc512f47de334541b6b Mon Sep 17 00:00:00 2001 From: Lance Edgar Date: Tue, 9 Feb 2021 16:12:32 -0600 Subject: [PATCH] Use `sku` instead of `upc` when fetching CORE `vendorItems` record since that is what API client now expects --- rattail_corepos/datasync/rattail.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/rattail_corepos/datasync/rattail.py b/rattail_corepos/datasync/rattail.py index 4495f4e..391c1a9 100644 --- a/rattail_corepos/datasync/rattail.py +++ b/rattail_corepos/datasync/rattail.py @@ -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):