2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-06-17 20:45:44 +00:00

Launch order dialog from the 'Parts' table

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

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: