mirror of
https://github.com/inventree/InvenTree.git
synced 2025-06-17 12:35:46 +00:00
Add ability to include test results from "installed items" in table
This commit is contained in:
@ -1331,14 +1331,27 @@ function loadStockTestResultsTable(table, options) {
|
||||
});
|
||||
|
||||
// Once the test template data are loaded, query for test results
|
||||
|
||||
var filters = loadTableFilters(filterKey);
|
||||
|
||||
var query_params = {
|
||||
stock_item: options.stock_item,
|
||||
user_detail: true,
|
||||
attachment_detail: true,
|
||||
ordering: '-date',
|
||||
};
|
||||
|
||||
if ('result' in filters) {
|
||||
query_params.result = filters.result;
|
||||
}
|
||||
|
||||
if ('include_installed' in filters) {
|
||||
query_params.include_installed = filters.include_installed;
|
||||
}
|
||||
|
||||
inventreeGet(
|
||||
'{% url "api-stock-test-result-list" %}',
|
||||
{
|
||||
stock_item: options.stock_item,
|
||||
user_detail: true,
|
||||
attachment_detail: true,
|
||||
ordering: '-date',
|
||||
},
|
||||
query_params,
|
||||
{
|
||||
success: function(data) {
|
||||
// Iterate through the returned test data
|
||||
|
@ -265,7 +265,16 @@ function getAvailableTableFilters(tableKey) {
|
||||
|
||||
// Filters for the 'stock test' table
|
||||
if (tableKey == 'stocktests') {
|
||||
return {};
|
||||
return {
|
||||
result: {
|
||||
type: 'bool',
|
||||
title: '{% trans "Test Passed" %}',
|
||||
},
|
||||
include_installed: {
|
||||
type: 'bool',
|
||||
title: '{% trans "Include Installed Items" %}',
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
// Filters for the 'part test template' table
|
||||
|
Reference in New Issue
Block a user