From 03043e67c79c25a333e40455be80cc613237266a Mon Sep 17 00:00:00 2001 From: Oliver Walters Date: Sun, 15 Sep 2019 19:58:05 +1000 Subject: [PATCH] Perform full validation when importing data --- InvenTree/company/admin.py | 3 +++ InvenTree/part/admin.py | 4 ++++ InvenTree/stock/admin.py | 2 ++ 3 files changed, 9 insertions(+) diff --git a/InvenTree/company/admin.py b/InvenTree/company/admin.py index ada60c7975..ce023aedc0 100644 --- a/InvenTree/company/admin.py +++ b/InvenTree/company/admin.py @@ -23,6 +23,7 @@ class CompanyResource(ModelResource): model = Company skip_unchanged = True report_skipped = False + clean_model_instances = True class CompanyAdmin(ImportExportModelAdmin): @@ -43,6 +44,7 @@ class SupplierPartResource(ModelResource): model = SupplierPart skip_unchanged = True report_skipped = False + clean_model_instances = True class SupplierPartAdmin(ImportExportModelAdmin): @@ -63,6 +65,7 @@ class SupplierPriceBreakResource(ModelResource): model = SupplierPriceBreak skip_unchanged = True report_skipped = False + clean_model_instances = True class SupplierPriceBreakAdmin(ImportExportModelAdmin): diff --git a/InvenTree/part/admin.py b/InvenTree/part/admin.py index 331a3f943b..601815caec 100644 --- a/InvenTree/part/admin.py +++ b/InvenTree/part/admin.py @@ -48,6 +48,7 @@ class PartResource(ModelResource): model = Part skip_unchanged = True report_skipped = False + clean_model_instances = True exclude = [ 'bom_checksum', 'bom_checked_by', 'bom_checked_date' ] @@ -91,6 +92,7 @@ class PartCategoryResource(ModelResource): model = PartCategory skip_unchanged = True report_skipped = False + clean_model_instances = True exclude = [ # Exclude MPTT internal model fields @@ -135,6 +137,7 @@ class BomItemResource(ModelResource): model = BomItem skip_unchanged = True report_skipped = False + clean_model_instances = True class BomItemAdmin(ImportExportModelAdmin): @@ -165,6 +168,7 @@ class ParameterResource(ModelResource): model = PartParameter skip_unchanged = True report_skipped = False + clean_model_instance = True class ParameterAdmin(ImportExportModelAdmin): diff --git a/InvenTree/stock/admin.py b/InvenTree/stock/admin.py index a791b30ae1..225c86dfc2 100644 --- a/InvenTree/stock/admin.py +++ b/InvenTree/stock/admin.py @@ -28,6 +28,7 @@ class LocationResource(ModelResource): model = StockLocation skip_unchanged = True report_skipped = False + clean_model_instances = True exclude = [ # Exclude MPTT internal model fields @@ -86,6 +87,7 @@ class StockItemResource(ModelResource): model = StockItem skip_unchanged = True report_skipped = False + clean_model_instance = True class StockItemAdmin(ImportExportModelAdmin):