mirror of
https://github.com/inventree/InvenTree.git
synced 2025-06-17 20:45:44 +00:00
Index page for showing all purchase orders
This commit is contained in:
27
InvenTree/order/templates/order/purchase_orders.html
Normal file
27
InvenTree/order/templates/order/purchase_orders.html
Normal file
@ -0,0 +1,27 @@
|
||||
{% extends "base.html" %}
|
||||
|
||||
{% load static %}
|
||||
|
||||
{% block content %}
|
||||
|
||||
<h4>Purchase Orders</h4>
|
||||
|
||||
|
||||
<table class='table table-striped table-condensed' id='po-table'>
|
||||
<tr>
|
||||
<th>Reference</th>
|
||||
<th>Company</th>
|
||||
<th>Description</th>
|
||||
<th>Status</th>
|
||||
</tr>
|
||||
{% for order in orders %}
|
||||
<tr>
|
||||
<td>{{ order }}</td>
|
||||
<td>{{ order.supplier }}</td>
|
||||
<td>{{ order.description }}</td>
|
||||
<td>{% include "order/order_status.html" %}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</table>
|
||||
|
||||
{% endblock %}
|
20
InvenTree/order/urls.py
Normal file
20
InvenTree/order/urls.py
Normal file
@ -0,0 +1,20 @@
|
||||
"""
|
||||
URL lookup for the Order app. Provides URL endpoints for:
|
||||
|
||||
- List view of Purchase Orders
|
||||
- Detail view of Purchase Orders
|
||||
"""
|
||||
|
||||
from django.conf.urls import url, include
|
||||
|
||||
from . import views
|
||||
|
||||
purchase_order_urls = [
|
||||
|
||||
# Display complete list of purchase orders
|
||||
url(r'^.*$', views.PurchaseOrderIndex.as_view(), name='purchase-order-index'),
|
||||
]
|
||||
|
||||
order_urls = [
|
||||
url(r'^purchase-order/', include(purchase_order_urls)),
|
||||
]
|
@ -1,3 +1,26 @@
|
||||
from django.shortcuts import render
|
||||
"""
|
||||
Django views for interacting with Order app
|
||||
"""
|
||||
|
||||
# Create your views here.
|
||||
# -*- coding: utf-8 -*-
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from django.views.generic import DetailView, ListView
|
||||
|
||||
from .models import PurchaseOrder
|
||||
|
||||
from InvenTree.status_codes import OrderStatus
|
||||
|
||||
|
||||
class PurchaseOrderIndex(ListView):
|
||||
|
||||
model = PurchaseOrder
|
||||
template_name = 'order/purchase_orders.html'
|
||||
context_object_name = 'orders'
|
||||
|
||||
def get_context_data(self):
|
||||
ctx = super().get_context_data()
|
||||
|
||||
ctx['OrderStatus'] = OrderStatus
|
||||
|
||||
return ctx
|
||||
|
Reference in New Issue
Block a user