From 3f809a90012404bdb0b26d38ae0256ad4847a2e9 Mon Sep 17 00:00:00 2001 From: Oliver Walters Date: Thu, 13 Jun 2019 19:35:38 +1000 Subject: [PATCH] List active purchase orders for each selected supplier --- InvenTree/order/templates/order/order_wizard/select_pos.html | 5 +++++ InvenTree/order/views.py | 4 ++++ 2 files changed, 9 insertions(+) diff --git a/InvenTree/order/templates/order/order_wizard/select_pos.html b/InvenTree/order/templates/order/order_wizard/select_pos.html index 140527f72e..03094ecdda 100644 --- a/InvenTree/order/templates/order/order_wizard/select_pos.html +++ b/InvenTree/order/templates/order/order_wizard/select_pos.html @@ -37,6 +37,11 @@ id='id_purchase_order_{{ supplier.id }}' name='purchase_order_{{ supplier.id }}'> + {% for order in supplier.outstanding_purchase_orders %} + + {% endfor %} diff --git a/InvenTree/order/views.py b/InvenTree/order/views.py index 68273f7410..303e713a2d 100644 --- a/InvenTree/order/views.py +++ b/InvenTree/order/views.py @@ -185,6 +185,10 @@ class OrderParts(AjaxView): if not supplier.name in suppliers: supplier.order_items = [] suppliers[supplier.name] = supplier + + print("Supplier:", supplier.name) + for order in supplier.outstanding_purchase_orders(): + print("order:", order.reference) suppliers[supplier.name].order_items.append(part)