mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
preparing stuff for gen get_field_selection()
This commit is contained in:
parent
64f8846e99
commit
db9fd28276
@ -783,15 +783,6 @@ class PartImport(FileManagementFormView):
|
|||||||
|
|
||||||
def get_field_selection(self):
|
def get_field_selection(self):
|
||||||
""" Fill the form fields for step 3 """
|
""" Fill the form fields for step 3 """
|
||||||
|
|
||||||
self.file_manager.setup()
|
|
||||||
# collect reference indexes
|
|
||||||
idx_s = {}
|
|
||||||
for col in self.file_manager.HEADERS:
|
|
||||||
index = self.get_column_index(col)
|
|
||||||
if index >= 0:
|
|
||||||
idx_s[col] = index
|
|
||||||
|
|
||||||
# fetch available elements
|
# fetch available elements
|
||||||
self.allowed_items = {}
|
self.allowed_items = {}
|
||||||
self.matches = {}
|
self.matches = {}
|
||||||
@ -803,6 +794,15 @@ class PartImport(FileManagementFormView):
|
|||||||
self.allowed_items['default_supplier'] = SupplierPart.objects.all()
|
self.allowed_items['default_supplier'] = SupplierPart.objects.all()
|
||||||
self.matches['default_supplier'] = ['SKU__contains']
|
self.matches['default_supplier'] = ['SKU__contains']
|
||||||
|
|
||||||
|
# setup
|
||||||
|
self.file_manager.setup()
|
||||||
|
# collect reference indexes
|
||||||
|
idx_s = {}
|
||||||
|
for col in self.file_manager.HEADERS:
|
||||||
|
index = self.get_column_index(col)
|
||||||
|
if index >= 0:
|
||||||
|
idx_s[col] = index
|
||||||
|
|
||||||
for row in self.rows:
|
for row in self.rows:
|
||||||
for idx in idx_s:
|
for idx in idx_s:
|
||||||
data = row['data'][idx_s[idx]]['cell']
|
data = row['data'][idx_s[idx]]['cell']
|
||||||
|
Loading…
Reference in New Issue
Block a user