diff --git a/rattail_quickbooks/importing/model.py b/rattail_quickbooks/importing/model.py index 24fb9db..e72470b 100644 --- a/rattail_quickbooks/importing/model.py +++ b/rattail_quickbooks/importing/model.py @@ -31,6 +31,14 @@ from rattail import importing # core importer overrides ############################## +class StoreImporter(importing.model.StoreImporter): + + extension_attr = '_quickbooks' + extension_fields = [ + 'quickbooks_location', + ] + + class DepartmentImporter(importing.model.DepartmentImporter): extension_attr = '_quickbooks' diff --git a/rattail_quickbooks/importing/versions.py b/rattail_quickbooks/importing/versions.py index f5a07e3..e0ed813 100644 --- a/rattail_quickbooks/importing/versions.py +++ b/rattail_quickbooks/importing/versions.py @@ -30,10 +30,34 @@ from rattail.importing import versions as base class QuickbooksVersionMixin(object): def add_quickbooks_importers(self, importers): - importers['QuickbooksExportableInvoiceImporter'] = QuickbooksExportableInvoiceImporter + importers['QuickbooksStore'] = QuickbooksStoreImporter + importers['QuickbooksDepartment'] = QuickbooksDepartmentImporter + importers['QuickbooksVendor'] = QuickbooksVendorImporter + importers['QuickbooksExportableInvoice'] = QuickbooksExportableInvoiceImporter return importers +class QuickbooksStoreImporter(base.VersionImporter): + + @property + def host_model_class(self): + return self.model.QuickbooksStore + + +class QuickbooksDepartmentImporter(base.VersionImporter): + + @property + def host_model_class(self): + return self.model.QuickbooksDepartment + + +class QuickbooksVendorImporter(base.VersionImporter): + + @property + def host_model_class(self): + return self.model.QuickbooksVendor + + class QuickbooksExportableInvoiceImporter(base.VersionImporter): @property