2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-07-01 11:10:54 +00:00

Adds option to hide unavailable stock items from the search preview window

This commit is contained in:
Oliver
2022-05-20 17:10:51 +10:00
parent 0f4ed55bed
commit 8da278a072
3 changed files with 28 additions and 12 deletions

View File

@ -122,14 +122,22 @@ function updateSearch() {
if (user_settings.SEARCH_PREVIEW_SHOW_STOCK) {
// Search for matching stock items
var filters = {
part_detail: true,
location_detail: true,
};
if (user_settings.SEARCH_PREVIEW_HIDE_UNAVAILABLE_STOCK) {
// Only show 'in stock' items in the preview windoww
filters.in_stock = true;
}
addSearchQuery(
'stock',
'{% trans "Stock Items" %}',
'{% url "api-stock-list" %}',
{
part_detail: true,
location_detail: true,
},
filters,
renderStockItem,
{
url: '/stock/item',