mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
Add "sent_to_customer" filter
This commit is contained in:
parent
502702b3bc
commit
0da9e0f834
@ -477,6 +477,17 @@ class StockList(generics.ListCreateAPIView):
|
||||
if customer:
|
||||
queryset = queryset.filter(customer=customer)
|
||||
|
||||
# Filter if items have been sent to a customer (any customer)
|
||||
sent_to_customer = params.get('sent_to_customer', None)
|
||||
|
||||
if sent_to_customer is not None:
|
||||
sent_to_customer = str2bool(sent_to_customer)
|
||||
|
||||
if sent_to_customer:
|
||||
queryset = queryset.exclude(customer=None)
|
||||
else:
|
||||
queryset = queryset.filter(customer=None)
|
||||
|
||||
# Filter by "serialized" status?
|
||||
serialized = params.get('serialized', None)
|
||||
|
||||
|
@ -57,6 +57,11 @@ function getAvailableTableFilters(tableKey) {
|
||||
title: '{% trans "In Stock" %}',
|
||||
description: '{% trans "Show items which are in stock" %}',
|
||||
},
|
||||
sent_to_customer: {
|
||||
type: 'bool',
|
||||
title: '{% trans "Sent to customer" %}',
|
||||
description: '{% trans "Show items which have been assigned to a customer" %}',
|
||||
},
|
||||
serialized: {
|
||||
type: 'bool',
|
||||
title: '{% trans "Is Serialized" %}',
|
||||
|
Loading…
Reference in New Issue
Block a user