From 8aa5452dd4cd2c0d984321cc9cb5c6579d547c1b Mon Sep 17 00:00:00 2001 From: Oliver Walters Date: Wed, 5 Jun 2019 21:17:29 +1000 Subject: [PATCH] Add secondary modal to create a new supplier part --- .../templates/order/purchase_order_detail.html | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/InvenTree/order/templates/order/purchase_order_detail.html b/InvenTree/order/templates/order/purchase_order_detail.html index 9cee52bed0..30eb48849c 100644 --- a/InvenTree/order/templates/order/purchase_order_detail.html +++ b/InvenTree/order/templates/order/purchase_order_detail.html @@ -70,8 +70,12 @@ InvenTree | {{ order }} {% for line in order.lines.all %} {{ forloop.counter }} + {% if line.part %} {{ line.part.part.full_name }} {{ line.part.SKU }} + {% else %} + Warning: Part has been deleted. + {% endif %} {{ line.reference }} {{ line.quantity }} {{ line.received }} @@ -98,6 +102,17 @@ $('#new-po-line').click(function() { data: { order: {{ order.id }}, }, + secondary: [ + { + field: 'part', + label: 'New Supplier Part', + title: 'Create new supplier part', + url: "{% url 'supplier-part-create' %}", + data: { + supplier: {{ order.supplier.id }}, + }, + }, + ], } ); });