Use sku instead of upc when fetching CORE vendorItems record
				
					
				
			since that is what API client now expects
This commit is contained in:
		
							parent
							
								
									83ba5c9ace
								
							
						
					
					
						commit
						a72fd9ef77
					
				
					 1 changed files with 6 additions and 5 deletions
				
			
		|  | @ -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): | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Lance Edgar
						Lance Edgar