mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
Trackable build part fix (#7196)
* Build Order Page fix: - Do not request test information for non trackable parts * Typo fix
This commit is contained in:
parent
29fa5cfafa
commit
b7da959dbd
@ -366,6 +366,7 @@ onPanelLoad('outputs', function() {
|
|||||||
source_location: {{ build.take_from.pk }},
|
source_location: {{ build.take_from.pk }},
|
||||||
{% endif %}
|
{% endif %}
|
||||||
tracked_parts: true,
|
tracked_parts: true,
|
||||||
|
trackable: {% js_bool build.part.trackable %}
|
||||||
};
|
};
|
||||||
|
|
||||||
loadBuildOutputTable(build_info);
|
loadBuildOutputTable(build_info);
|
||||||
|
@ -1111,8 +1111,7 @@ function loadBuildOutputTable(build_info, options={}) {
|
|||||||
|
|
||||||
setupFilterList('builditems', $(table), options.filterTarget || '#filter-list-incompletebuilditems', {
|
setupFilterList('builditems', $(table), options.filterTarget || '#filter-list-incompletebuilditems', {
|
||||||
labels: {
|
labels: {
|
||||||
url: '{% url "api-stockitem-label-list" %}',
|
model_type: 'stockitem',
|
||||||
key: 'item',
|
|
||||||
},
|
},
|
||||||
singular_name: '{% trans "build output" %}',
|
singular_name: '{% trans "build output" %}',
|
||||||
plural_name: '{% trans "build outputs" %}',
|
plural_name: '{% trans "build outputs" %}',
|
||||||
@ -1125,29 +1124,31 @@ function loadBuildOutputTable(build_info, options={}) {
|
|||||||
});
|
});
|
||||||
|
|
||||||
// Request list of required tests for the part being assembled
|
// Request list of required tests for the part being assembled
|
||||||
inventreeGet(
|
if (build_info.trackable) {
|
||||||
'{% url "api-part-test-template-list" %}',
|
inventreeGet(
|
||||||
{
|
'{% url "api-part-test-template-list" %}',
|
||||||
part: build_info.part,
|
{
|
||||||
required: true,
|
part: build_info.part,
|
||||||
enabled: true,
|
required: true,
|
||||||
},
|
enabled: true,
|
||||||
{
|
|
||||||
async: false,
|
|
||||||
success: function(response) {
|
|
||||||
test_templates = [];
|
|
||||||
response.forEach(function(item) {
|
|
||||||
// Only include "required" tests
|
|
||||||
if (item.required) {
|
|
||||||
test_templates.push(item);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
},
|
},
|
||||||
error: function() {
|
{
|
||||||
test_templates = [];
|
async: false,
|
||||||
|
success: function(response) {
|
||||||
|
test_templates = [];
|
||||||
|
response.forEach(function(item) {
|
||||||
|
// Only include "required" tests
|
||||||
|
if (item.required) {
|
||||||
|
test_templates.push(item);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
error: function() {
|
||||||
|
test_templates = [];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
);
|
||||||
);
|
}
|
||||||
|
|
||||||
// Callback function to load the allocated stock items
|
// Callback function to load the allocated stock items
|
||||||
function reloadOutputAllocations() {
|
function reloadOutputAllocations() {
|
||||||
@ -2006,7 +2007,6 @@ function loadBuildTable(table, options) {
|
|||||||
setupFilterList('build', table, filterTarget, {
|
setupFilterList('build', table, filterTarget, {
|
||||||
download: true,
|
download: true,
|
||||||
report: {
|
report: {
|
||||||
url: '{% url "api-build-report-list" %}',
|
|
||||||
key: 'build',
|
key: 'build',
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@ -2450,8 +2450,7 @@ function loadBuildLineTable(table, build_id, options={}) {
|
|||||||
if (!options.data) {
|
if (!options.data) {
|
||||||
setupFilterList('buildlines', $(table), filterTarget, {
|
setupFilterList('buildlines', $(table), filterTarget, {
|
||||||
labels: {
|
labels: {
|
||||||
url: '{% url "api-buildline-label-list" %}',
|
modeltype: 'buildline',
|
||||||
key: 'line',
|
|
||||||
},
|
},
|
||||||
singular_name: '{% trans "build line" %}',
|
singular_name: '{% trans "build line" %}',
|
||||||
plural_name: '{% trans "build lines" %}',
|
plural_name: '{% trans "build lines" %}',
|
||||||
|
Loading…
Reference in New Issue
Block a user