From f136f90e129b3fb44bc98d96927a9835367c174f Mon Sep 17 00:00:00 2001 From: Matthias Date: Sat, 15 May 2021 00:59:47 +0200 Subject: [PATCH] config for all form-fields --- InvenTree/common/forms.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/InvenTree/common/forms.py b/InvenTree/common/forms.py index 8a0017e38b..c869d4a4f3 100644 --- a/InvenTree/common/forms.py +++ b/InvenTree/common/forms.py @@ -151,6 +151,8 @@ class MatchItem(forms.Form): # Set field name field_name = col_guess.lower() + '-' + str(row['index']) # Set field input box + + # TODO maybe not here but in an own function? if 'quantity' in col_guess.lower(): self.fields[field_name] = forms.CharField( 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 elif col_guess in file_manager.ITEM_MATCH_HEADERS: # Get item options