2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-06-19 05:25:42 +00:00

Added edit views for stock

- StockItem
- StockLocation
This commit is contained in:
Oliver
2018-04-15 23:27:56 +10:00
parent 3c844fc77f
commit 55b533d3ef
18 changed files with 168 additions and 22 deletions

View File

@ -23,7 +23,6 @@ class PartCategory(InvenTreeTree):
verbose_name = "Part Category"
verbose_name_plural = "Part Categories"
@property
def partcount(self):
""" Return the total part count under this category

View File

@ -18,7 +18,7 @@ Are you sure you want to delete category '{{ category.name }}'?
<ul class='list-group'>
{% for cat in category.children.all %}
<li class='list-group-item'>{{ cat.name }} - {{ cat.description }}</li>
<li class='list-group-item'><b>{{ cat.name }}</b> - <i>{{ cat.description }}</i></li>
{% endfor %}
</ul>
{% endif %}
@ -33,7 +33,7 @@ Are you sure you want to delete category '{{ category.name }}'?
</p>
<ul class='list-group'>
{% for part in category.parts.all %}
<li class='list-group-item'>{{ part.name }} - {{ part.description }}</li>
<li class='list-group-item'><b>{{ part.name }}</b> - <i>{{ part.description }}</i></li>
{% endfor %}
</ul>
{% endif %}

View File

@ -10,6 +10,7 @@ Total in stock: {{ part.stock }}
<table class="table table-striped">
<tr>
<th>Link</th>
<th>Quantity</th>
<th>Location</th>
<th>Supplier part</th>
@ -18,8 +19,9 @@ Total in stock: {{ part.stock }}
</tr>
{% for stock in part.locations.all %}
<tr>
<td><a href="{% url 'stock-item-detail' stock.id %}">Click</a></td>
<td>{{ stock.quantity }}</td>
<td><a href="/stock/list/?location={{ stock.location.id }}">{{ stock.location.name }}</a></td>
<td><a href="{% url 'stock-location-detail' stock.location.id %}">{{ stock.location.name }}</a></td>
<td>
{% if stock.supplier_part %}
<a href="{% url 'supplier-part-detail' stock.supplier_part.id %}">
@ -31,6 +33,12 @@ Total in stock: {{ part.stock }}
<td>{{ stock.notes }}</td>
</tr>
{% endfor %}
</table>
</table
<div class='container-fluid'>
<a href="{% url 'stock-item-create' %}?part={{ part.id }}">
<button class='btn btn-success'>Add new Stock Item</button>
</a>
</div>
{% endblock %}

View File

@ -7,14 +7,14 @@
{% if part.supplier_parts.all|length > 0 %}
<table class="table table-striped">
<tr>
<th>Supplier</th>
<th>SKU</th>
<th>Supplier</th>
<th>URL</th>
</tr>
{% for spart in part.supplier_parts.all %}
<tr>
<td><a href="{% url 'supplier-detail' spart.supplier.id %}">{{ spart.supplier.name }}</a></td>
<td><a href="{% url 'supplier-part-detail' spart.id %}">{{ spart.SKU }}</a></td>
<td><a href="{% url 'supplier-detail' spart.supplier.id %}">{{ spart.supplier.name }}</a></td>
<td>
{% if spart.URL %}
<a href="{{ spart.URL }}">{{ spart.URL }}</a>