2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-07-01 11:10:54 +00:00

Add stock information for top-level stock page

This commit is contained in:
Oliver Walters
2019-09-27 09:59:14 +10:00
parent b876d31d09
commit 3e2a5263a5
6 changed files with 147 additions and 50 deletions

View File

@ -1,5 +1,6 @@
{% extends "stock/stock_app_base.html" %}
{% load static %}
{% load i18n %}
{% block content %}
<div class='row'>
@ -33,25 +34,37 @@
</div>
<div class='col-sm-6'>
{% if location %}
<h3>Location Details</h3>
<h3>{% trans "Location Details" %}</h3>
<table class='table table-striped table-condensed'>
<tr>
<td>Location Path</td>
<td>{% trans "Location Path" %}</td>
<td>{{ location.pathstring }}</td>
</tr>
<tr>
<td>Location Description</td>
<td>{% trans "Location Description" %}</td>
<td>{{ location.description }}</td>
</tr>
<tr>
<td>Sublocations</td>
<td>{% trans "Sublocations" %}</td>
<td>{{ location.children.count }}</td>
</tr>
<tr>
<td>Stock Items</td>
<td>{% trans "Stock Items" %}</td>
<td>{{ location.item_count }}</td>
</tr>
</table>
{% else %}
<h3>{% trans "Stock Details" %}</h3>
<table class='table table-striped table-condensed'>
<tr>
<td>{% trans "Stock Locations" %}</td>
<td>{{ loc_count }}</td>
</tr>
<tr>
<td>{% trans "Stock Items" %}</td>
<td>{{ stock_count }}</td>
</tr>
</table>
{% endif %}
</div>
</h3>

View File

@ -53,6 +53,9 @@ class StockIndex(ListView):
context['locations'] = locations
context['items'] = StockItem.objects.all()
context['loc_count'] = StockLocation.objects.count()
context['stock_count'] = StockItem.objects.count()
return context