mirror of
https://github.com/inventree/InvenTree.git
synced 2025-04-30 20:46:47 +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 %}
|
{% for order in orders %}
|
||||||
<tr>
|
<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>{% 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>{{ order.description }}</td>
|
||||||
<td>{% include "order/order_status.html" %}</td>
|
<td>{% include "order/order_status.html" %}</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
@ -9,8 +9,16 @@ from django.conf.urls import url, include
|
|||||||
|
|
||||||
from . import views
|
from . import views
|
||||||
|
|
||||||
|
purchase_order_detail_urls = [
|
||||||
|
|
||||||
|
url(r'^.*$', views.PurchaseOrderDetail.as_view(), name='purchase-order-detail'),
|
||||||
|
]
|
||||||
|
|
||||||
purchase_order_urls = [
|
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
|
# Display complete list of purchase orders
|
||||||
url(r'^.*$', views.PurchaseOrderIndex.as_view(), name='purchase-order-index'),
|
url(r'^.*$', views.PurchaseOrderIndex.as_view(), name='purchase-order-index'),
|
||||||
]
|
]
|
||||||
|
@ -13,6 +13,7 @@ from InvenTree.status_codes import OrderStatus
|
|||||||
|
|
||||||
|
|
||||||
class PurchaseOrderIndex(ListView):
|
class PurchaseOrderIndex(ListView):
|
||||||
|
""" List view for all purchase orders """
|
||||||
|
|
||||||
model = PurchaseOrder
|
model = PurchaseOrder
|
||||||
template_name = 'order/purchase_orders.html'
|
template_name = 'order/purchase_orders.html'
|
||||||
@ -24,3 +25,11 @@ class PurchaseOrderIndex(ListView):
|
|||||||
ctx['OrderStatus'] = OrderStatus
|
ctx['OrderStatus'] = OrderStatus
|
||||||
|
|
||||||
return ctx
|
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…
x
Reference in New Issue
Block a user