mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
Add option to delete columns
This commit is contained in:
parent
54762713f3
commit
3c2f3c2c2c
@ -35,6 +35,7 @@
|
||||
{% for req in req_cols %}
|
||||
<option value='{{ req }}'{% if req == col.guess %}selected='selected'{% endif %}>{{ req }}</option>
|
||||
{% endfor %}
|
||||
<option value='Delete'>Delete Column</option>
|
||||
</select>
|
||||
{% if col.duplicate %}
|
||||
<p class='help-inline'>Duplicate column selection</p>
|
||||
|
@ -767,6 +767,9 @@ class BomUpload(AjaxView, FormMixin):
|
||||
col_id = int(item.replace('col_select_', ''))
|
||||
col_name = value
|
||||
|
||||
if value.lower() == 'delete':
|
||||
continue
|
||||
|
||||
column_selections[col_id] = value
|
||||
|
||||
# Extract the row data
|
||||
@ -822,6 +825,10 @@ class BomUpload(AjaxView, FormMixin):
|
||||
row = row_data[row_idx]
|
||||
items = []
|
||||
for col_idx in sorted(row.keys()):
|
||||
|
||||
if not col_idx in column_selections.keys():
|
||||
continue
|
||||
|
||||
value = row[col_idx]
|
||||
items.append(value)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user