mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
config for all form-fields
This commit is contained in:
parent
0c5fa57770
commit
f136f90e12
@ -151,6 +151,8 @@ class MatchItem(forms.Form):
|
|||||||
# Set field name
|
# Set field name
|
||||||
field_name = col_guess.lower() + '-' + str(row['index'])
|
field_name = col_guess.lower() + '-' + str(row['index'])
|
||||||
# Set field input box
|
# Set field input box
|
||||||
|
|
||||||
|
# TODO maybe not here but in an own function?
|
||||||
if 'quantity' in col_guess.lower():
|
if 'quantity' in col_guess.lower():
|
||||||
self.fields[field_name] = forms.CharField(
|
self.fields[field_name] = forms.CharField(
|
||||||
required=False,
|
required=False,
|
||||||
@ -164,6 +166,15 @@ class MatchItem(forms.Form):
|
|||||||
})
|
})
|
||||||
)
|
)
|
||||||
|
|
||||||
|
else:
|
||||||
|
# Get value
|
||||||
|
value = row.get(col_guess.lower(), '')
|
||||||
|
# Set field input box
|
||||||
|
self.fields[field_name] = forms.CharField(
|
||||||
|
required=True,
|
||||||
|
initial=value,
|
||||||
|
)
|
||||||
|
|
||||||
# Create item selection box
|
# Create item selection box
|
||||||
elif col_guess in file_manager.ITEM_MATCH_HEADERS:
|
elif col_guess in file_manager.ITEM_MATCH_HEADERS:
|
||||||
# Get item options
|
# Get item options
|
||||||
|
Loading…
Reference in New Issue
Block a user