mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
Merge pull request #1051 from SchrodingersGat/po-stock-list
Display table of items received against a particular purchase order
This commit is contained in:
commit
ce1cce99bb
34
InvenTree/order/templates/order/po_received_items.html
Normal file
34
InvenTree/order/templates/order/po_received_items.html
Normal 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 %}
|
@ -2,7 +2,10 @@
|
|||||||
|
|
||||||
<ul class='nav nav-tabs'>
|
<ul class='nav nav-tabs'>
|
||||||
<li{% ifequal tab 'details' %} class='active'{% endifequal %}>
|
<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>
|
||||||
<li{% if tab == 'attachments' %} class='active'{% endif %}>
|
<li{% if tab == 'attachments' %} class='active'{% endif %}>
|
||||||
<a href="{% url 'po-attachments' order.id %}">{% trans "Attachments" %}
|
<a href="{% url 'po-attachments' order.id %}">{% trans "Attachments" %}
|
||||||
|
@ -21,6 +21,7 @@ purchase_order_detail_urls = [
|
|||||||
|
|
||||||
url(r'^notes/', views.PurchaseOrderNotes.as_view(), name='po-notes'),
|
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'^attachments/', views.PurchaseOrderDetail.as_view(template_name='order/po_attachments.html'), name='po-attachments'),
|
||||||
url(r'^.*$', views.PurchaseOrderDetail.as_view(), name='po-detail'),
|
url(r'^.*$', views.PurchaseOrderDetail.as_view(), name='po-detail'),
|
||||||
]
|
]
|
||||||
|
@ -498,6 +498,11 @@ class StockList(generics.ListCreateAPIView):
|
|||||||
if sales_order:
|
if sales_order:
|
||||||
queryset = queryset.filter(sales_order=sales_order)
|
queryset = queryset.filter(sales_order=sales_order)
|
||||||
|
|
||||||
|
purchase_order = params.get('purchase_order', None)
|
||||||
|
|
||||||
|
if purchase_order is not None:
|
||||||
|
queryset = queryset.filter(purchase_order=purchase_order)
|
||||||
|
|
||||||
# Filter stock items which are installed in another (specific) stock item
|
# Filter stock items which are installed in another (specific) stock item
|
||||||
installed_in = params.get('installed_in', None)
|
installed_in = params.get('installed_in', None)
|
||||||
|
|
||||||
|
@ -262,7 +262,7 @@ function loadStockTable(table, options) {
|
|||||||
formatNoMatches: function() {
|
formatNoMatches: function() {
|
||||||
return '{% trans "No stock items matching query" %}';
|
return '{% trans "No stock items matching query" %}';
|
||||||
},
|
},
|
||||||
url: options.url,
|
url: options.url || "{% url 'api-stock-list' %}",
|
||||||
queryParams: filters,
|
queryParams: filters,
|
||||||
customSort: customGroupSorter,
|
customSort: customGroupSorter,
|
||||||
groupBy: true,
|
groupBy: true,
|
||||||
|
Loading…
Reference in New Issue
Block a user