From 04abe2b3d110af37778443578ac80d221cfc7aaa Mon Sep 17 00:00:00 2001 From: Oliver Walters Date: Wed, 5 Jun 2019 21:50:11 +1000 Subject: [PATCH] Display list of purchase orders against a particular supplier par --- InvenTree/company/templates/company/partdetail.html | 5 ++++- InvenTree/company/views.py | 6 ++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/InvenTree/company/templates/company/partdetail.html b/InvenTree/company/templates/company/partdetail.html index dd43d0c5e4..681ba25074 100644 --- a/InvenTree/company/templates/company/partdetail.html +++ b/InvenTree/company/templates/company/partdetail.html @@ -101,7 +101,10 @@ InvenTree | {{ company.name }} - Parts -
+
+ +

Purchase Orders

+{% include "order/po_table.html" with orders=part.purchase_orders %} {% endblock %} diff --git a/InvenTree/company/views.py b/InvenTree/company/views.py index f9e032cbe9..c3cda22e39 100644 --- a/InvenTree/company/views.py +++ b/InvenTree/company/views.py @@ -128,6 +128,12 @@ class SupplierPartDetail(DetailView): context_object_name = 'part' queryset = SupplierPart.objects.all() + def get_context_data(self, **kwargs): + ctx = super().get_context_data(**kwargs) + ctx['OrderStatus'] = OrderStatus + + return ctx + class SupplierPartEdit(AjaxUpdateView): """ Update view for editing SupplierPart """