2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-06-17 20:45:44 +00:00

Display table of items received against a particular purchase order

- Adds new tab to "Purchase Order" view
- Adds ability to filter StockList API by purchase_order ID
This commit is contained in:
Oliver Walters
2020-10-19 11:40:57 +11:00
parent 2dc9109b11
commit 634410294b
5 changed files with 45 additions and 2 deletions

View File

@ -0,0 +1,34 @@
{% extends "order/order_base.html" %}
{% load inventree_extras %}
{% load i18n %}
{% load static %}
{% block details %}
{% include 'order/po_tabs.html' with tab='received' %}
<h4>{% trans "Received Items" %}</h4>
<hr>
{% include "stock_table.html" with read_only=True %}
{% endblock %}
{% block js_ready %}
{{ block.super }}
loadStockTable($("#stock-table"), {
params: {
purchase_order: {{ order.id }},
part_detail: true,
supplier_detail: true,
location_detail: true,
},
buttons: [
'#stock-options',
],
filterkey: "postock"
});
{% endblock %}

View File

@ -2,7 +2,10 @@
<ul class='nav nav-tabs'>
<li{% ifequal tab 'details' %} class='active'{% endifequal %}>
<a href="{% url 'po-detail' order.id %}">{% trans "Items" %}</a>
<a href="{% url 'po-detail' order.id %}">{% trans "Line Items" %}</a>
</li>
<li {% if tab == 'received' %} class='active'{% endif %}>
<a href="{% url 'po-received' order.id %}">{% trans "Received Items" %}</a>
</li>
<li{% if tab == 'attachments' %} class='active'{% endif %}>
<a href="{% url 'po-attachments' order.id %}">{% trans "Attachments" %}

View File

@ -21,6 +21,7 @@ purchase_order_detail_urls = [
url(r'^notes/', views.PurchaseOrderNotes.as_view(), name='po-notes'),
url(r'^received/', views.PurchaseOrderDetail.as_view(template_name='order/po_received_items.html'), name='po-received'),
url(r'^attachments/', views.PurchaseOrderDetail.as_view(template_name='order/po_attachments.html'), name='po-attachments'),
url(r'^.*$', views.PurchaseOrderDetail.as_view(), name='po-detail'),
]