mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
Merge pull request #874 from SchrodingersGat/show_non_stock
Add ability to display "out of stock" items against a part
This commit is contained in:
commit
da70af7ba0
@ -14,7 +14,7 @@
|
||||
|
||||
function defaultFilters() {
|
||||
return {
|
||||
stock: "cascade=1",
|
||||
stock: "cascade=1&in_stock=1",
|
||||
build: "",
|
||||
parts: "cascade=1",
|
||||
company: "",
|
||||
|
@ -40,7 +40,6 @@
|
||||
part: {{ part.id }},
|
||||
location_detail: true,
|
||||
part_detail: true,
|
||||
in_stock: true,
|
||||
},
|
||||
groupByField: 'location',
|
||||
buttons: [
|
||||
|
@ -51,15 +51,6 @@
|
||||
</li>
|
||||
{% endif %}
|
||||
{% if part.trackable %}
|
||||
{% if 0 %}
|
||||
<!-- TODO - Add the 'tracking' tab back in -->
|
||||
<li{% ifequal tab 'track' %} class="active"{% endifequal %}>
|
||||
<a href="{% url 'part-track' part.id %}">{% trans "Tracking" %}
|
||||
{% if parts.serials.all|length > 0 %}
|
||||
<span class="badge">{{ part.serials.all|length }}</span>
|
||||
{% endif %}
|
||||
</a></li>
|
||||
{% endif %}
|
||||
<li{% ifequal tab 'tests' %} class='active'{% endifequal %}>
|
||||
<a href='{% url "part-test-templates" part.id %}'>{% trans "Tests" %}
|
||||
{% if part.getTestTemplates.count > 0 %}<span class='badge'>{{ part.getTestTemplates.count }}</span>{% endif %}
|
||||
|
@ -71,6 +71,7 @@ class StockItemSerializer(InvenTreeModelSerializer):
|
||||
'belongs_to',
|
||||
'build',
|
||||
'build_order',
|
||||
'customer',
|
||||
'sales_order',
|
||||
'supplier_part',
|
||||
'supplier_part__supplier',
|
||||
@ -141,6 +142,7 @@ class StockItemSerializer(InvenTreeModelSerializer):
|
||||
'batch',
|
||||
'build_order',
|
||||
'belongs_to',
|
||||
'customer',
|
||||
'in_stock',
|
||||
'link',
|
||||
'location',
|
||||
|
@ -248,7 +248,6 @@
|
||||
{% endif %}
|
||||
part_detail: true,
|
||||
location_detail: true,
|
||||
in_stock: true,
|
||||
},
|
||||
url: "{% url 'api-stock-list' %}",
|
||||
});
|
||||
|
@ -494,10 +494,15 @@ function loadStockTable(table, options) {
|
||||
sortable: true,
|
||||
formatter: function(value, row, index, field) {
|
||||
if (value) {
|
||||
return renderLink(value, '/stock/location/' + row.location + '/');
|
||||
return renderLink(value, `/stock/location/${row.location}/`);
|
||||
}
|
||||
else {
|
||||
return '<i>{% trans "No stock location set" %}</i>';
|
||||
if (row.customer) {
|
||||
var text = "{% trans "Shipped to customer" %}";
|
||||
return renderLink(text, `/company/${row.customer}/assigned-stock/`);
|
||||
} else {
|
||||
return '<i>{% trans "No stock location set" %}</i>';
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
|
@ -14,6 +14,11 @@ function getAvailableTableFilters(tableKey) {
|
||||
// Filters for the "Stock" table
|
||||
if (tableKey == 'stock') {
|
||||
return {
|
||||
in_stock: {
|
||||
type: 'bool',
|
||||
title: '{% trans "In Stock" %}',
|
||||
description: '{% trans "Show items which are in stock" %}',
|
||||
},
|
||||
cascade: {
|
||||
type: 'bool',
|
||||
title: '{% trans "Include sublocations" %}',
|
||||
|
Loading…
Reference in New Issue
Block a user