mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
Make Reference and Notes fields editable
This commit is contained in:
parent
b77bfc74ea
commit
3930651c59
@ -63,6 +63,11 @@ class BomUploadManager:
|
||||
'Notes'
|
||||
]
|
||||
|
||||
EDITABLE_HEADERS = [
|
||||
'Reference',
|
||||
'Notes'
|
||||
]
|
||||
|
||||
HEADERS = REQUIRED_HEADERS + OPTIONAL_HEADERS
|
||||
|
||||
def __init__(self, bom_file):
|
||||
|
@ -46,8 +46,16 @@
|
||||
<td>{% add row.index 1 %}</td>
|
||||
{% for item in row.data %}
|
||||
<td>
|
||||
{% if item.column.guess == 'Quantity' %}
|
||||
{% if item.column.guess == 'Part' %}
|
||||
<select class='select' id='id_part_{{ row.index }}' name='part_select_{{ row.index }}'>
|
||||
<option value=''>---------</option>
|
||||
</select>
|
||||
<br>
|
||||
{{ item.cell }}
|
||||
{% elif item.column.guess == 'Quantity' %}
|
||||
<input class='numberinput' type='number' min='1' value='{{ row.quantity }}'/>
|
||||
{% elif item.editable %}
|
||||
<input id='id_edit_{{ item.column.guess }}_{{ row.index }}' name='edit_{{ item.column.guess }}_{{ row.index }}' value='{{ item.cell }}'/>
|
||||
{% else %}
|
||||
{{ item.cell }}
|
||||
{% endif %}
|
||||
|
@ -688,7 +688,8 @@ class BomUpload(FormView):
|
||||
data.append({
|
||||
'cell': item,
|
||||
'idx': idx,
|
||||
'column': self.bom_columns[idx]
|
||||
'column': self.bom_columns[idx],
|
||||
'editable': self.bom_columns[idx].get('guess', None) in BomUploadManager.EDITABLE_HEADERS
|
||||
})
|
||||
|
||||
rows.append({
|
||||
|
Loading…
Reference in New Issue
Block a user