Fix CORE API -> Rattail datasync for ProductCost

This commit is contained in:
Lance Edgar 2021-01-31 21:53:26 -06:00
parent f61a0a7dd9
commit 67618d4784
2 changed files with 35 additions and 11 deletions

View file

@ -108,6 +108,14 @@ class FromCOREAPIToRattail(NewDataSyncImportConsumer):
self.process_change(session, self.importers['Product'],
host_object=product)
# sync all ProductCost-related changes
types = [
'VendorItem',
]
for change in [c for c in changes if c.payload_type in types]:
# normal logic works fine here
self.invoke_importer(session, change)
def get_host_object(self, session, change):
if change.payload_type == 'Member':
return self.api.get_member(change.payload_key)