From f61a0a7dd94341dff8e3d25d0d30e2a8686020ab Mon Sep 17 00:00:00 2001 From: Lance Edgar Date: Sat, 30 Jan 2021 13:17:45 -0600 Subject: [PATCH] Add importer support for `VendorItem` this was done mostly for CORE <-> CORE diffs --- rattail_corepos/corepos/importing/db/corepos.py | 4 ++++ rattail_corepos/corepos/importing/db/model.py | 5 +++++ 2 files changed, 9 insertions(+) diff --git a/rattail_corepos/corepos/importing/db/corepos.py b/rattail_corepos/corepos/importing/db/corepos.py index 774781f..ea02791 100644 --- a/rattail_corepos/corepos/importing/db/corepos.py +++ b/rattail_corepos/corepos/importing/db/corepos.py @@ -65,6 +65,7 @@ class FromCoreToCoreBase(object): importers['VendorContact'] = VendorContactImporter importers['Product'] = ProductImporter importers['ProductFlag'] = ProductFlagImporter + importers['VendorItem'] = VendorItemImporter importers['Employee'] = EmployeeImporter importers['CustData'] = CustDataImporter importers['MemberType'] = MemberTypeImporter @@ -137,6 +138,9 @@ class ProductImporter(FromCore, corepos_importing.model.ProductImporter): class ProductFlagImporter(FromCore, corepos_importing.model.ProductFlagImporter): pass +class VendorItemImporter(FromCore, corepos_importing.model.VendorItemImporter): + pass + class EmployeeImporter(FromCore, corepos_importing.model.EmployeeImporter): pass diff --git a/rattail_corepos/corepos/importing/db/model.py b/rattail_corepos/corepos/importing/db/model.py index 68a0584..2cb8c95 100644 --- a/rattail_corepos/corepos/importing/db/model.py +++ b/rattail_corepos/corepos/importing/db/model.py @@ -118,6 +118,11 @@ class ProductFlagImporter(ToCore): key = 'bit_number' +class VendorItemImporter(ToCore): + model_class = corepos.VendorItem + key = ('sku', 'vendor_id') + + class EmployeeImporter(ToCore): model_class = corepos.Employee key = 'number'