mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
Add a detail view for purchase orders
This commit is contained in:
parent
7bca9cc7af
commit
c82d5482aa
@ -0,0 +1,9 @@
|
||||
{% extends "base.html" %}
|
||||
|
||||
{% block content %}
|
||||
|
||||
Purchase Order: {{ order.reference }}
|
||||
<br><hr>
|
||||
Description: {{ order.description }}
|
||||
|
||||
{% endblock %}
|
@ -17,7 +17,7 @@
|
||||
{% for order in orders %}
|
||||
<tr>
|
||||
<td>{% include "hover_image.html" with image=order.supplier.image hover=True %}<a href="{{ order.supplier.get_absolute_url }}">{{ order.supplier.name }}</a></td>
|
||||
<td>{{ order }}</td>
|
||||
<td><a href="{% url 'purchase-order-detail' order.id %}">{{ order }}</a></td>
|
||||
<td>{{ order.description }}</td>
|
||||
<td>{% include "order/order_status.html" %}</td>
|
||||
</tr>
|
||||
|
@ -9,8 +9,16 @@ from django.conf.urls import url, include
|
||||
|
||||
from . import views
|
||||
|
||||
purchase_order_detail_urls = [
|
||||
|
||||
url(r'^.*$', views.PurchaseOrderDetail.as_view(), name='purchase-order-detail'),
|
||||
]
|
||||
|
||||
purchase_order_urls = [
|
||||
|
||||
# Display detail view for a single purchase order
|
||||
url(r'^(?P<pk>\d+)/', include(purchase_order_detail_urls)),
|
||||
|
||||
# Display complete list of purchase orders
|
||||
url(r'^.*$', views.PurchaseOrderIndex.as_view(), name='purchase-order-index'),
|
||||
]
|
||||
|
@ -13,6 +13,7 @@ from InvenTree.status_codes import OrderStatus
|
||||
|
||||
|
||||
class PurchaseOrderIndex(ListView):
|
||||
""" List view for all purchase orders """
|
||||
|
||||
model = PurchaseOrder
|
||||
template_name = 'order/purchase_orders.html'
|
||||
@ -24,3 +25,11 @@ class PurchaseOrderIndex(ListView):
|
||||
ctx['OrderStatus'] = OrderStatus
|
||||
|
||||
return ctx
|
||||
|
||||
|
||||
class PurchaseOrderDetail(DetailView):
|
||||
""" Detail view for a PurchaseOrder object """
|
||||
|
||||
context_object_name = 'order'
|
||||
queryset = PurchaseOrder.objects.all().prefetch_related('lines')
|
||||
template_name = 'order/purchase_order_detail.html'
|
||||
|
Loading…
Reference in New Issue
Block a user