Add all model/version importers

This commit is contained in:
Lance Edgar 2022-12-21 06:05:34 -06:00
parent 9394171ba5
commit 9ca0637be5
2 changed files with 33 additions and 1 deletions

View file

@ -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'

View file

@ -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