mirror of
				https://github.com/inventree/InvenTree.git
				synced 2025-10-31 13:15:43 +00:00 
			
		
		
		
	Index page for showing all purchase orders
This commit is contained in:
		| @@ -15,10 +15,9 @@ from company.urls import supplier_part_urls | ||||
| from company.urls import price_break_urls | ||||
|  | ||||
| from part.urls import part_urls | ||||
|  | ||||
| from stock.urls import stock_urls | ||||
|  | ||||
| from build.urls import build_urls | ||||
| from order.urls import order_urls | ||||
|  | ||||
| from part.api import part_api_urls, bom_api_urls | ||||
| from company.api import company_api_urls | ||||
| @@ -56,6 +55,7 @@ urlpatterns = [ | ||||
|     url(r'^stock/', include(stock_urls)), | ||||
|  | ||||
|     url(r'^company/', include(company_urls)), | ||||
|     url(r'^order/', include(order_urls)), | ||||
|  | ||||
|     url(r'^build/', include(build_urls)), | ||||
|  | ||||
|   | ||||
							
								
								
									
										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 | ||||
|   | ||||
| @@ -10,6 +10,7 @@ | ||||
|       <li><a href="{% url 'stock-index' %}">Stock</a></li> | ||||
|       <li><a href="{% url 'build-index' %}">Build</a></li> | ||||
|       <li><a href="{% url 'company-index' %}">Suppliers</a></li> | ||||
|       <li><a href="{% url 'purchase-order-index' %}">Orders</a></li> | ||||
|     </ul> | ||||
|     <ul class="nav navbar-nav navbar-right"> | ||||
|         {% include "search_form.html" %} | ||||
|   | ||||
		Reference in New Issue
	
	Block a user