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

Almost there, needs some interface testing and tweaking

This commit is contained in:
eeintech
2021-03-30 18:08:33 -04:00
parent 9c8817d73b
commit 0b1f22c7fd
7 changed files with 103 additions and 16 deletions

View File

@ -773,7 +773,7 @@ class StockList(generics.ListCreateAPIView):
company = params.get('company', None)
if company is not None:
queryset = queryset.filter(Q(supplier_part__supplier=company) | Q(supplier_part__manufacturer=company))
queryset = queryset.filter(Q(supplier_part__supplier=company) | Q(supplier_part__manufacturer_part__manufacturer=company))
# Filter by supplier
supplier = params.get('supplier', None)
@ -785,7 +785,7 @@ class StockList(generics.ListCreateAPIView):
manufacturer = params.get('manufacturer', None)
if manufacturer is not None:
queryset = queryset.filter(supplier_part__manufacturer=manufacturer)
queryset = queryset.filter(supplier_part__manufacturer_part__manufacturer=manufacturer)
"""
Filter by the 'last updated' date of the stock item(s):

View File

@ -84,7 +84,7 @@ class StockItemSerializer(InvenTreeModelSerializer):
'sales_order',
'supplier_part',
'supplier_part__supplier',
'supplier_part__manufacturer',
'supplier_part__manufacturer_part__manufacturer',
'allocations',
'sales_order_allocations',
'location',