Adds a "stock items" view for a part category

- Shows any stock items for parts which exist in (or under) the selected category
This commit is contained in:
Oliver Walters 2022-04-19 18:04:48 +10:00
parent 86c7417296
commit 39a77f7f3a
2 changed files with 26 additions and 0 deletions

View File

@ -187,6 +187,15 @@
</div>
</div>
<div class='panel panel-hidden' id='panel-stock'>
<div class='panel-heading'>
<h4>{% trans "Stock Items" %}</h4>
</div>
<div class='panel-content'>
{% include "stock_table.html" %}
</div>
</div>
<div class='panel panel-hidden' id='panel-parameters'>
<div class='panel-heading'>
<h4>{% trans "Part Parameters" %}</h4>
@ -223,6 +232,21 @@
{{ block.super }}
{% if category %}
onPanelLoad('stock', function() {
loadStockTable(
$('#stock-table'),
{
params: {
category: {{ category.pk }},
part_detail: true,
location_detail: true,
supplier_part_detail: true,
}
}
);
});
onPanelLoad('parameters', function() {
loadParametricPartTable(
"#parametric-part-table",

View File

@ -14,6 +14,8 @@
{% include "sidebar_link.html" with url=url text=text icon="fa-file-upload" %}
{% endif %}
{% if category %}
{% trans "Stock Items" as text %}
{% include "sidebar_item.html" with label='stock' text=text icon='fa-boxes' %}
{% trans "Parameters" as text %}
{% include "sidebar_item.html" with label="parameters" text=text icon="fa-tasks" %}
{% endif %}