Launch order dialog from the 'Parts' table

This commit is contained in:
Oliver Walters committed 2019-06-11 23:55:20 +10:00
1 parent 0ca01fb0e7
commit 1cb6c67086
3 files changed
+34 -1

No files matched your search

+15 -1
View File
@@ -194,8 +194,22 @@ class OrderParts(AjaxView):
for item in stock_items:
part_ids.add(item.part.id)
print("Parts:", part_ids)
# User has passed a list of part ID values
if '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)
for part in parts:
part_ids.add(part.id)
print("Parts:", part_ids)
# Create the list of parts
for id in part_ids: