mirror of
https://github.com/inventree/InvenTree.git
synced 2025-08-07 04:12:11 +00:00
Added supplier web interface
- Display list of suppliers - Supplier detail page - Supplier part detail page - Part detail now includes list of supplier parts
This commit is contained in:
@@ -9,10 +9,18 @@ Used in {{ part.usedInCount }} other parts.<br>
|
||||
|
||||
<a href="{% url 'part-stock' part.id %}">There are {{ part.stock }} units in stock.</a>
|
||||
|
||||
<br>
|
||||
{% if part.supplier_parts.all|length > 0 %}
|
||||
This part is available from <a href="{% url 'part-suppliers' part.id %}">{{ part.supplier_parts.all|length }} suppliers</a>.
|
||||
{% else %}
|
||||
There are no suppliers defined for this part.
|
||||
{% endif %}
|
||||
|
||||
<br><br>
|
||||
{% if part.trackable %}
|
||||
<a href="{% url 'part-track' part.id %}">Part tracking</a>
|
||||
{% else %}
|
||||
{{ part.name }} does not have part tracking enabled
|
||||
{% endif %}
|
||||
|
||||
{% endblock %}
|
@@ -20,7 +20,9 @@ Total in stock: {{ part.stock }}
|
||||
<td><a href="/stock/list/?location={{ stock.location.id }}">{{ stock.location.name }}</a></td>
|
||||
<td>
|
||||
{% if stock.supplier_part %}
|
||||
<a href="{% url 'supplier-part-detail' stock.supplier_part.id %}">
|
||||
{{ stock.supplier_part.supplier.name }} | {{ stock.supplier_part.SKU }}
|
||||
</a>
|
||||
{% endif %}
|
||||
</td>
|
||||
<td>{% if stock.stocktake_date %}{{ stock.stocktake_date }}{% endif %}</td>
|
||||
|
24
InvenTree/part/templates/part/supplier.html
Normal file
24
InvenTree/part/templates/part/supplier.html
Normal file
@@ -0,0 +1,24 @@
|
||||
{% extends "part/part_base.html" %}
|
||||
|
||||
{% block details %}
|
||||
|
||||
{% if part.supplier_parts.all|length > 0 %}
|
||||
<table>
|
||||
<tr>
|
||||
<th>Supplier</th>
|
||||
<th>SKU</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>{{ spart.URL }}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</table>
|
||||
{% else %}
|
||||
There are no suppliers defined for this part, sorry!
|
||||
{% endif %}
|
||||
|
||||
{% endblock %}
|
@@ -42,6 +42,7 @@ part_detail_urls = [
|
||||
url(r'^track/?', views.track, name='part-track'),
|
||||
url(r'^bom/?', views.bom, name='part-bom'),
|
||||
url(r'^stock/?', views.stock, name='part-stock'),
|
||||
url(r'^suppliers/?', views.suppliers, name='part-suppliers'),
|
||||
url('', views.detail, name='part-detail'),
|
||||
]
|
||||
|
||||
|
@@ -64,3 +64,8 @@ def track(request, pk):
|
||||
|
||||
return render(request, 'part/track.html', {'part': part})
|
||||
|
||||
|
||||
def suppliers(request, pk):
|
||||
part = get_object_or_404(Part, pk=pk)
|
||||
|
||||
return render(request, 'part/supplier.html', {'part' : part})
|
||||
|
Reference in New Issue
Block a user