2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-06-16 12:05:53 +00:00

Order from supplier 'parts list' page

This commit is contained in:
Oliver Walters
2019-06-12 00:10:39 +10:00
parent e4f5cc8ccd
commit 74327d3094
2 changed files with 18 additions and 18 deletions

View File

@ -160,8 +160,6 @@ class OrderParts(AjaxView):
ctx = {}
print("Getting context data")
ctx['parts'] = self.get_parts()
return ctx
@ -179,9 +177,6 @@ class OrderParts(AjaxView):
if 'stock[]' in self.request.GET:
stock_id_list = self.request.GET.getlist('stock[]')
print("Looking up parts from stock items:")
print(stock_id_list)
""" Get a list of all the parts associated with the stock items.
- Base part must be purchaseable.
@ -205,15 +200,10 @@ class OrderParts(AjaxView):
except Part.DoesNotExist:
pass
# User has passed a list of part ID values
elif 'parts[]' in self.request.GET:
part_id_list = self.request.GET.getlist('parts[]')
print("Provided list of part:")
print(part_id_list)
parts = Part.objects.filter(
purchaseable=True,
id__in=part_id_list)
@ -221,8 +211,6 @@ class OrderParts(AjaxView):
for part in parts:
part_ids.add(part.id)
print("Parts:", part_ids)
# Create the list of parts
for id in part_ids:
try:
@ -238,10 +226,6 @@ class OrderParts(AjaxView):
self.request = request
print("GET HERE")
print(request.GET)
self.get_parts()
return self.renderJsonResponse(request)
@ -249,8 +233,7 @@ class OrderParts(AjaxView):
def post(self, request, *args, **kwargs):
self.request = request
print("POST here")
data = {
'form_valid': False,
}