mirror of
https://github.com/inventree/InvenTree.git
synced 2025-06-19 05:25:42 +00:00
Annotate stock queryset with stale status
This commit is contained in:
@ -102,6 +102,7 @@ loadStockTable($("#expired-stock-table"), {
|
||||
loadStockTable($("#stale-stock-table"), {
|
||||
params: {
|
||||
stale: true,
|
||||
expired: false,
|
||||
location_detail: true,
|
||||
part_detail: true,
|
||||
},
|
||||
|
@ -534,7 +534,9 @@ function loadStockTable(table, options) {
|
||||
}
|
||||
|
||||
if (row.expired) {
|
||||
html += makeIconBadge('fa-stopwatch icon-red', '{% trans "Stock item has expired" %}');
|
||||
html += makeIconBadge('fa-calendar-times icon-red', '{% trans "Stock item has expired" %}');
|
||||
} else if (row.stale) {
|
||||
html += makeIconBadge('fa-stopwatch', '{% trans "Stock item will expire soon" %}');
|
||||
}
|
||||
|
||||
if (row.allocated) {
|
||||
|
@ -111,6 +111,11 @@ function getAvailableTableFilters(tableKey) {
|
||||
title: '{% trans "Expired" %}',
|
||||
description: '{% trans "Show stock items which have expired" %}',
|
||||
},
|
||||
stale: {
|
||||
type: 'bool',
|
||||
title: '{% trans "Stale" %}',
|
||||
description: '{% trans "Show stock which is close to expiring" %}',
|
||||
},
|
||||
in_stock: {
|
||||
type: 'bool',
|
||||
title: '{% trans "In Stock" %}',
|
||||
|
Reference in New Issue
Block a user