Add build orders to search results list

This commit is contained in:
Oliver Walters 2021-03-03 08:44:13 +11:00
parent 14000517ce
commit 979f543c3f
8 changed files with 19 additions and 9 deletions

View File

@ -51,7 +51,7 @@ class BuildList(generics.ListCreateAPIView):
search_fields = [
'reference',
'part__name',
'description',
'title',
]
def get_queryset(self):

View File

@ -33,7 +33,6 @@ loadBuildTable($('#sub-build-table'), {
url: '{% url "api-build-list" %}',
filterTarget: "#filter-list-sub-build",
params: {
part_detail: true,
ancestor: {{ build.pk }},
}
});

View File

@ -179,9 +179,6 @@ $("#new-build").click(function() {
loadBuildTable($("#build-table"), {
url: "{% url 'api-build-list' %}",
params: {
part_detail: "true",
},
});
$('#multi-build-print').click(function() {

View File

@ -27,7 +27,6 @@ loadBuildTable($("#builds-table"), {
url: "{% url 'api-build-list' %}",
params: {
sales_order: {{ order.id }},
part_detail: true,
},
});

View File

@ -43,7 +43,6 @@
loadBuildTable($("#build-table"), {
url: "{% url 'api-build-list' %}",
params: {
part_detail: "true",
part: {{ part.id }},
}
});

View File

@ -185,7 +185,6 @@ addHeaderAction('build-overdue', '{% trans "Overdue Build Orders" %}', 'fa-calen
loadBuildTable("#table-build-pending", {
url: "{% url 'api-build-list' %}",
params: {
part_detail: true,
active: true,
},
disableFilters: true,
@ -194,7 +193,6 @@ loadBuildTable("#table-build-pending", {
loadBuildTable("#table-build-overdue", {
url: "{% url 'api-build-list' %}",
params: {
part_detail: true,
overdue: true,
},
disableFilters: true,

View File

@ -162,6 +162,20 @@ InvenTree | {% trans "Search Results" %}
{% endif %}
{% if roles.build.view %}
addItemTitle('{% trans "Build" %}');
addItem('build-order', '{% trans "Build Orders" %}', 'fa-tools');
loadBuildTable('#table-build-order', {
params: {
search: '{{ query }}',
}
});
{% endif %}
{% if roles.stock.view %}
addItemTitle('{% trans "Stock" %}');

View File

@ -610,6 +610,8 @@ function loadBuildTable(table, options) {
var filters = {};
params['part_detail'] = true;
if (!options.disableFilters) {
filters = loadTableFilters("build");
}
@ -618,6 +620,8 @@ function loadBuildTable(table, options) {
filters[key] = params[key];
}
options.url = options.url || '{% url "api-build-list" %}';
var filterTarget = options.filterTarget || null;
setupFilterList("build", table, filterTarget);