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

Match each part to the list of available parts

- Order selections based on "best" match
This commit is contained in:
Oliver Walters
2019-07-07 11:44:17 +10:00
parent f251620917
commit a6da3ed4a4
3 changed files with 35 additions and 7 deletions

View File

@@ -49,12 +49,11 @@
{% if item.column.guess == 'Part' %}
<select class='select bomselect' id='id_part_{{ row.index }}' name='part_select_{{ row.index }}'>
<option value=''>---------</option>
{% for part in allowed_parts_list %}
<option value='{{ part.id }}'>{{ part.full_name }} - {{ part.description }}</option>
{% for part in row.part_options %}
<option value='{{ part.id }}'>{{ part.full_name }} - <i>{{ part.description }}</i></option>
{% endfor %}
</select>
<br>
{{ item.cell }}
<i>{{ item.cell }}</i>
{% elif item.column.guess == 'Quantity' %}
<input class='numberinput' type='number' min='1' value='{{ row.quantity }}'/>
{% elif item.editable %}
@@ -76,6 +75,9 @@
{% block js_ready %}
{{ block.super }}
$('.bomselect').select2();
$('.bomselect').select2({
dropdownAutoWidth: true,
matcher: partialMatcher,
});
{% endblock %}