From 62672059666864b0155d2374efff484d08a061c5 Mon Sep 17 00:00:00 2001 From: Lance Edgar Date: Fri, 9 Jun 2023 17:41:32 -0500 Subject: [PATCH] Avoid the `Change` model by default, for CSV -> CORE import --- rattail_corepos/corepos/office/importing/db/csv.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/rattail_corepos/corepos/office/importing/db/csv.py b/rattail_corepos/corepos/office/importing/db/csv.py index 753fe61..7222cb5 100644 --- a/rattail_corepos/corepos/office/importing/db/csv.py +++ b/rattail_corepos/corepos/office/importing/db/csv.py @@ -48,3 +48,13 @@ class FromCSVToCore(FromCSVToSQLAlchemyMixin, FromFileHandler, ToCoreHandler): def make_session(self): return CoreSession(bind=self.config.corepos_engines[self.dbkey]) + + def get_default_keys(self): + keys = super().get_default_keys() + + # error will occur for any missing files, when running for all + # default models. so make sure some of these are not default. + if 'Change' in keys: + keys.remove('Change') + + return keys