2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-08-14 07:31:10 +00:00

Add pages for part tracking

- Edit / Delete / Create tracking info
- Improvements to many pages
This commit is contained in:
Oliver
2018-04-16 00:30:57 +10:00
parent 55b533d3ef
commit 8e6de1b832
26 changed files with 302 additions and 58 deletions

View File

@@ -4,12 +4,40 @@
{% include 'part/tabs.html' with tab='detail' %}
<table class='table table-striped'>
<tr>
<td>Name</td>
<td>{{ part.name }}</td>
</tr>
<tr>
<td>Description</td>
<td>{{ part.decription }}</td>
</tr>
<tr>
<td>Category</td>
<td>
{% if part.category %}
<a href="{% url 'category-detail' part.category.id %}">{{ part.category.name }}</a>
{% endif %}
</td>
</tr>
<tr>
<td>Units</td>
<td>{{ part.units }}</td>
</tr>
<tr>
<td>Trackable</td>
<td>{{ part.trackable }}</td>
</tr>
<tr>
<td>Purchaseable</td>
<td>{{ part.purchaseable }}</td>
</tr>
</table>
Part details go here...
<br>
<div class='container-fluid'>
<a href="{% url 'part-edit' part.id %}"><button class="btn btn-info">Edit Part</button></a>
<a href="{% url 'part-delete' part.id %}"><button class="btn btn-danger">Delete Part</button></a>
</div>
{% endblock %}

View File

@@ -6,33 +6,54 @@
{% include "part/cat_link.html" with category=part.category %}
<div class="media">
<div class="media-left">
<img class="part-thumb"
{% if part.image %}
src="{{ part.image.url }}"
{% else %}
src="{% static 'img/blank_image.png' %}"
{% endif %}/>
</div>
<div class="media-body">
<h4>{{ part.name }}</h4>
{% if part.description %}
<p><i>{{ part.description }}</i></p>
{% endif %}
{% if part.IPN %}
<p><b>IPN:</b> {{ part.IPN }}</p>
{% endif %}
{% if part.URL %}
<p>{% include 'url.html' with url=part.URL %}</p>
{% endif %}
<div class="row">
<div class="col-sm-6">
<div class="media">
<div class="media-left">
<img class="part-thumb"
{% if part.image %}
src="{{ part.image.url }}"
{% else %}
src="{% static 'img/blank_image.png' %}"
{% endif %}/>
</div>
<div class="media-body">
<h4>{{ part.name }}</h4>
{% if part.description %}
<p><i>{{ part.description }}</i></p>
{% endif %}
</div>
</div>
</div>
<div class="col-sm-6">
<table class="table table-striped">
{% if part.IPN %}
<tr>
<td>IPN</td>
<td>{{ part.IPN }}</td>
</tr>
{% endif %}
{% if part.URL %}
<tr>
<td>URL</td>
<td><a href="{{ part.URL }}">{{ part.URL }}</a></td>
</tr>
{% endif %}
<tr>
<td>Stock</td>
<td>{{ part.stock }}</td>
</tr>
</table>
</div>
</div>
<hr>
<div class='container-fluid'>
{% block details %}
<!-- Specific part details go here... -->
{% endblock %}
</div>
{% endblock %}

View File

@@ -4,7 +4,6 @@
{% include 'part/tabs.html' with tab='suppliers' %}
{% if part.supplier_parts.all|length > 0 %}
<table class="table table-striped">
<tr>
<th>SKU</th>
@@ -23,8 +22,11 @@
</tr>
{% endfor %}
</table>
{% else %}
There are no suppliers defined for this part, sorry!
{% endif %}
<div class='container-fluid'>
<a href="{% url 'supplier-part-create' %}?part={{ part.id }}">
<button class="btn btn-success">New Supplier Part</button>
</a>
</div>
{% endblock %}

View File

@@ -1,15 +1,25 @@
<ul class="nav nav-tabs">
<li{% ifequal tab 'detail' %} class="active"{% endifequal %}><a href="{% url 'part-detail' part.id %}">Details</a></li>
<li{% ifequal tab 'bom' %} class="active"{% endifequal %}><a href="{% url 'part-bom' part.id %}">BOM <span class="badge">{{ part.bomItemCount }}</span></a></li>
<li{% ifequal tab 'bom' %} class="active"{% endifequal %}><a href="{% url 'part-bom' part.id %}">BOM{% if part.bomItemCount > 0 %}<span class="badge">{{ part.bomItemCount }}</span>{% endif %}</a></li>
{% if part.bomItemCount > 0 %}
<li{% ifequal tab 'build' %} class "active"{% endifequal %}><a href="#">Build</a></li>
{% endif %}
{% if part.usedInCount > 0 %}
<li{% ifequal tab 'used' %} class="active"{% endifequal %}><a href="{% url 'part-used-in' part.id %}">Used In <span class="badge">{{ part.usedInCount }}</span></a></li>
<li{% ifequal tab 'used' %} class="active"{% endifequal %}><a href="{% url 'part-used-in' part.id %}">Used In{% if part.usedInCount > 0 %}<span class="badge">{{ part.usedInCount }}</span>{% endif %}</a></li>
{% endif %}
<li{% ifequal tab 'stock' %} class="active"{% endifequal %}><a href="{% url 'part-stock' part.id %}">Stock <span class="badge">{{ part.stock }}</span></a></li>
<li{% ifequal tab 'suppliers' %} class="active"{% endifequal %}><a href="{% url 'part-suppliers' part.id %}">Suppliers <span class="badge">{{ part.supplier_parts.all|length }}<span></a></li>
{% if part.purchaseable %}
<li{% ifequal tab 'suppliers' %} class="active"{% endifequal %}><a href="{% url 'part-suppliers' part.id %}">Suppliers
{% if part.supplier_parts.all|length > 0 %}
<span class="badge">{{ part.supplier_parts.all|length }}<span>
{% endif %}
</a></li>
{% endif %}
{% if part.trackable %}
<li{% ifequal tab 'track' %} class="active"{% endifequal %}><a href="{% url 'part-track' part.id %}">Tracking <span class="badge">{{ part.serials.all|length }}</span></a></li>
<li{% ifequal tab 'track' %} class="active"{% endifequal %}><a href="{% url 'part-track' part.id %}">Tracking
{% if parts.serials.all|length > 0 %}
<span class="badge">{{ part.serials.all|length }}</span>
{% endif %}
</a></li>
{% endif %}
</ul>

View File

@@ -11,12 +11,18 @@ Part tracking for {{ part.name }}
<th>Serial</th>
<th>Status</th>
</tr>
{% for track in part.serials.all %}
{% for track in part.tracked_parts.all %}
<tr>
<td>{{ track.serial }}</td>
<td>{{ track.status }}</td>
<td><a href="{% url 'track-detail' track.id %}">{{ track.serial }}</a></td>
<td>{{ track.get_status_display }}</td>
</tr>
{% endfor %}
</table>
<div class='container-fluid'>
<a href="{% url 'track-create' %}?part={{ part.id }}">
<button class="btn btn-success">New Tracked Part</button>
</a>
</div>
{% endblock %}

View File

@@ -4,8 +4,6 @@
{% include 'part/tabs.html' with tab='used' %}
This part is used to make the following parts:
<table class="table table-striped">
<tr>
<th>Part</th>