diff --git a/InvenTree/order/views.py b/InvenTree/order/views.py index d200392084..6f466d687c 100644 --- a/InvenTree/order/views.py +++ b/InvenTree/order/views.py @@ -194,9 +194,21 @@ class OrderParts(AjaxView): for item in stock_items: part_ids.add(item.part.id) + # User has passed a single Part ID + elif 'part' in self.request.GET: + try: + part_id = self.request.GET.get('part') + part = Part.objects.get(id=part_id) + + part_ids.add(part.id) + + except Part.DoesNotExist: + pass + + # User has passed a list of part ID values - if 'parts[]' in self.request.GET: + elif 'parts[]' in self.request.GET: part_id_list = self.request.GET.getlist('parts[]') print("Provided list of part:") diff --git a/InvenTree/part/templates/part/detail.html b/InvenTree/part/templates/part/detail.html index b536a5542e..fe357a6bdc 100644 --- a/InvenTree/part/templates/part/detail.html +++ b/InvenTree/part/templates/part/detail.html @@ -15,6 +15,9 @@