From 2b74a0ed2cfda0808f7bb89131c2965b0e7c327a Mon Sep 17 00:00:00 2001 From: Oliver Walters Date: Thu, 13 Jun 2019 21:28:01 +1000 Subject: [PATCH] Don't show zero-quantity items when ordering against a build --- InvenTree/build/templates/build/allocate_view.html | 2 ++ InvenTree/order/views.py | 3 +++ 2 files changed, 5 insertions(+) diff --git a/InvenTree/build/templates/build/allocate_view.html b/InvenTree/build/templates/build/allocate_view.html index 31d35b43f9..4f60405ff0 100644 --- a/InvenTree/build/templates/build/allocate_view.html +++ b/InvenTree/build/templates/build/allocate_view.html @@ -13,6 +13,7 @@ Part Description Available + On Order Required Allocated @@ -26,6 +27,7 @@ {{ item.part.description }} {{ item.part.total_stock }} + {{ item.part.on_order }} {{ item.quantity }} {{ item.allocated }} diff --git a/InvenTree/order/views.py b/InvenTree/order/views.py index 69766db282..450a4c87a4 100644 --- a/InvenTree/order/views.py +++ b/InvenTree/order/views.py @@ -255,6 +255,9 @@ class OrderParts(AjaxView): parts = build.part.required_parts() for part in parts: + # If ordering from a Build page, ignore parts that we have enough of + if part.quantity_to_order <= 0: + continue part_ids.add(part.id) except Build.DoesNotExist: pass