mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
Adds "refresh" button for stock test table
This commit is contained in:
parent
578c161d4f
commit
6199223636
@ -1232,7 +1232,30 @@ function formatDate(row) {
|
||||
*/
|
||||
function loadStockTestResultsTable(table, options) {
|
||||
|
||||
// Setup filters for the table
|
||||
var filterTarget = options.filterTarget || '#filter-list-stocktests';
|
||||
|
||||
var filterKey = options.filterKey || options.name || 'stocktests';
|
||||
|
||||
var filters = loadTableFilters(filterKey);
|
||||
|
||||
var params = {
|
||||
part: options.part,
|
||||
};
|
||||
|
||||
var original = {};
|
||||
|
||||
for (var k in params) {
|
||||
original[k] = params[k];
|
||||
filters[k] = params[k];
|
||||
}
|
||||
|
||||
setupFilterList(filterKey, table, filterTarget);
|
||||
|
||||
function makeButtons(row, grouped) {
|
||||
|
||||
// Helper function for rendering buttons
|
||||
|
||||
var html = `<div class='btn-group float-right' role='group'>`;
|
||||
|
||||
if (row.requires_attachment == false && row.requires_value == false && !row.result) {
|
||||
@ -1268,9 +1291,8 @@ function loadStockTestResultsTable(table, options) {
|
||||
formatNoMatches: function() {
|
||||
return '{% trans "No test results found" %}';
|
||||
},
|
||||
queryParams: {
|
||||
part: options.part,
|
||||
},
|
||||
queryParams: filters,
|
||||
original: original,
|
||||
onPostBody: function() {
|
||||
table.treegrid({
|
||||
treeColumn: 0,
|
||||
|
@ -265,12 +265,7 @@ function getAvailableTableFilters(tableKey) {
|
||||
|
||||
// Filters for the 'stock test' table
|
||||
if (tableKey == 'stocktests') {
|
||||
return {
|
||||
result: {
|
||||
type: 'bool',
|
||||
title: '{% trans "Test result" %}',
|
||||
},
|
||||
};
|
||||
return {};
|
||||
}
|
||||
|
||||
// Filters for the 'part test template' table
|
||||
|
Loading…
Reference in New Issue
Block a user