mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
Prevent copying of labels and templates during data import phase
This commit is contained in:
parent
2d7bff0773
commit
6e5fc43105
@ -1,4 +1,5 @@
|
||||
import os
|
||||
import sys
|
||||
import shutil
|
||||
import logging
|
||||
import hashlib
|
||||
@ -32,8 +33,16 @@ class LabelConfig(AppConfig):
|
||||
This function is called whenever the label app is loaded
|
||||
"""
|
||||
|
||||
self.create_stock_item_labels()
|
||||
self.create_stock_location_labels()
|
||||
if 'loaddata' in sys.argv:
|
||||
"""
|
||||
In the case we are importing records,
|
||||
do not automatically copy labels across.
|
||||
This can cause database conflicts!
|
||||
"""
|
||||
pass
|
||||
else:
|
||||
self.create_stock_item_labels()
|
||||
self.create_stock_location_labels()
|
||||
|
||||
def create_stock_item_labels(self):
|
||||
"""
|
||||
|
@ -1,4 +1,5 @@
|
||||
import os
|
||||
import sys
|
||||
import shutil
|
||||
import logging
|
||||
|
||||
@ -17,8 +18,11 @@ class ReportConfig(AppConfig):
|
||||
This function is called whenever the report app is loaded
|
||||
"""
|
||||
|
||||
self.create_default_test_reports()
|
||||
self.create_default_build_reports()
|
||||
if 'loaddata' in sys.argv:
|
||||
pass
|
||||
else:
|
||||
self.create_default_test_reports()
|
||||
self.create_default_build_reports()
|
||||
|
||||
def create_default_reports(self, model, reports):
|
||||
"""
|
||||
|
Loading…
Reference in New Issue
Block a user