2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-08-14 15:41:10 +00:00

Create a new part directly from the BOM view

- Pass data through to the part creation
- Populate the new part into the select dropdown
-
This commit is contained in:
Oliver Walters
2019-07-07 13:06:59 +10:00
parent ff5af8f217
commit 85e803f345
4 changed files with 65 additions and 18 deletions

View File

@@ -35,7 +35,7 @@
</thead>
<tbody>
{% for row in bom_rows %}
<tr>
<tr part-description='{{ row.description }}' part-select='#select_part_{{ row.index }}'>
<td>
<button class='btn btn-default btn-remove' id='del_row_{{ forloop.counter }}' style='display: inline; float: right;' title='Remove row'>
<span row_id='{{ forloop.counter }}' onClick='removeRowFromBomWizard()' class='glyphicon glyphicon-small glyphicon-remove'></span>
@@ -51,7 +51,7 @@
<span row_id='{{ row.index }}' class='glyphicon glyphicon-small glyphicon-plus' onClick='newPartFromBomWizard()'/>
</button>
<select class='select bomselect' id='id_part_{{ row.index }}' name='part_select_{{ row.index }}'>
<select class='select bomselect' id='select_part_{{ row.index }}' name='part_select_{{ row.index }}'>
<option value=''>---------</option>
{% for part in row.part_options %}
<option value='{{ part.id }}'>{{ part.full_name }} - <i>{{ part.description }}</i></option>
@@ -60,8 +60,12 @@
<i>{{ item.cell }}</i>
{% 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 }}'/>
{% elif item.column.guess == 'Reference' %}
<input name='reference_{{ row.index }}' value='{{ row.reference }}'/>
{% elif item.column.guess == 'Notes' %}
<input name='notes_{{ row.index }}' value='{{ row.notes }}'/>
{% elif item.column.guess == 'Overage' %}
<input name='overage_{{ row.index }}' value='{{ row.overage }}'/>
{% else %}
{{ item.cell }}
{% endif %}