mirror of
https://github.com/inventree/InvenTree.git
synced 2025-05-02 21:38:48 +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 %}
|
{% for req in req_cols %}
|
||||||
<option value='{{ req }}'{% if req == col.guess %}selected='selected'{% endif %}>{{ req }}</option>
|
<option value='{{ req }}'{% if req == col.guess %}selected='selected'{% endif %}>{{ req }}</option>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
<option value='Delete'>Delete Column</option>
|
||||||
</select>
|
</select>
|
||||||
{% if col.duplicate %}
|
{% if col.duplicate %}
|
||||||
<p class='help-inline'>Duplicate column selection</p>
|
<p class='help-inline'>Duplicate column selection</p>
|
||||||
|
@ -767,6 +767,9 @@ class BomUpload(AjaxView, FormMixin):
|
|||||||
col_id = int(item.replace('col_select_', ''))
|
col_id = int(item.replace('col_select_', ''))
|
||||||
col_name = value
|
col_name = value
|
||||||
|
|
||||||
|
if value.lower() == 'delete':
|
||||||
|
continue
|
||||||
|
|
||||||
column_selections[col_id] = value
|
column_selections[col_id] = value
|
||||||
|
|
||||||
# Extract the row data
|
# Extract the row data
|
||||||
@ -822,6 +825,10 @@ class BomUpload(AjaxView, FormMixin):
|
|||||||
row = row_data[row_idx]
|
row = row_data[row_idx]
|
||||||
items = []
|
items = []
|
||||||
for col_idx in sorted(row.keys()):
|
for col_idx in sorted(row.keys()):
|
||||||
|
|
||||||
|
if not col_idx in column_selections.keys():
|
||||||
|
continue
|
||||||
|
|
||||||
value = row[col_idx]
|
value = row[col_idx]
|
||||||
items.append(value)
|
items.append(value)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user