Perform full validation when importing data

This commit is contained in:
Oliver Walters 2019-09-15 19:58:05 +10:00
parent 2d17f957f1
commit 03043e67c7
3 changed files with 9 additions and 0 deletions

View File

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

View File

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

View File

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