mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
Added 'tabs' to company view
This commit is contained in:
parent
ee2f262e19
commit
d44a4e174b
@ -67,11 +67,3 @@ class Company(models.Model):
|
|||||||
def has_parts(self):
|
def has_parts(self):
|
||||||
return self.part_count > 0
|
return self.part_count > 0
|
||||||
|
|
||||||
@property
|
|
||||||
def order_count(self):
|
|
||||||
return self.orders.count()
|
|
||||||
|
|
||||||
@property
|
|
||||||
def has_orders(self):
|
|
||||||
return self.order_count > 0
|
|
||||||
|
|
||||||
|
@ -55,8 +55,14 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<hr>
|
||||||
|
|
||||||
|
<div class='container-fluid'>
|
||||||
|
|
||||||
{% block details %}
|
{% block details %}
|
||||||
|
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
{% endblock %}
|
{% endblock %}
|
@ -2,4 +2,6 @@
|
|||||||
|
|
||||||
{% block details %}
|
{% block details %}
|
||||||
|
|
||||||
|
{% include 'company/tabs.html' with tab='details' %}
|
||||||
|
|
||||||
{% endblock %}
|
{% endblock %}
|
@ -6,7 +6,7 @@
|
|||||||
|
|
||||||
<table class="table">
|
<table class="table">
|
||||||
<tr><td>SKU</td><td>{{ part.SKU }}</tr></tr>
|
<tr><td>SKU</td><td>{{ part.SKU }}</tr></tr>
|
||||||
<tr><td>Supplier</td><td><a href="{% url 'supplier-detail' part.supplier.id %}">{{ part.supplier.name }}</a></td></tr>
|
<tr><td>Supplier</td><td><a href="{% url 'company-detail' part.supplier.id %}">{{ part.supplier.name }}</a></td></tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>Parent Part</td>
|
<td>Parent Part</td>
|
||||||
<td>
|
<td>
|
||||||
|
@ -1,6 +1,18 @@
|
|||||||
<ul class='nav nav-tabs'>
|
<ul class='nav nav-tabs'>
|
||||||
<li{% if tab == 'parts' %} class='active'{% endif %}>
|
<li{% if tab == 'details' %} class='active'{% endif %}>
|
||||||
<a href="{% url 'supplier-detail' supplier.id %}">Parts <span class='badge'>{{ supplier.part_count }}</span></a></li>
|
<a href="{% url 'company-detail' company.id %}">Details</a>
|
||||||
<li{% if tab == 'order' %} class='active'{% endif %}>
|
</li>
|
||||||
<a href="{% url 'supplier-detail-orders' supplier.id %}">Orders <span class="badge">{{ supplier.order_count }}</span></a></li>
|
{% if company.is_supplier %}
|
||||||
|
<li{% if tab == 'parts' %} class='active'{% endif %}>
|
||||||
|
<a href="{% url 'company-detail' company.id %}">Supplier Parts <span class='badge'>{{ company.part_count }}</span></a>
|
||||||
|
</li>
|
||||||
|
<li{% if tab == 'po' %} class='active'{% endif %}>
|
||||||
|
<a href="#">Purchase Orders</a>
|
||||||
|
</li>
|
||||||
|
{% endif %}
|
||||||
|
{% if company.is_customer %}
|
||||||
|
<li{% if tab == 'co' %} class='active'{% endif %}>
|
||||||
|
<a href="#">Sales Orders</a>
|
||||||
|
</li>
|
||||||
|
{% endif %}
|
||||||
</ul>
|
</ul>
|
@ -353,6 +353,7 @@ class BomItem(models.Model):
|
|||||||
child=self.sub_part.name,
|
child=self.sub_part.name,
|
||||||
n=self.quantity)
|
n=self.quantity)
|
||||||
|
|
||||||
|
|
||||||
class SupplierPart(models.Model):
|
class SupplierPart(models.Model):
|
||||||
""" Represents a unique part as provided by a Supplier
|
""" Represents a unique part as provided by a Supplier
|
||||||
Each SupplierPart is identified by a MPN (Manufacturer Part Number)
|
Each SupplierPart is identified by a MPN (Manufacturer Part Number)
|
||||||
|
@ -26,13 +26,15 @@
|
|||||||
{% if part.default_location %}
|
{% if part.default_location %}
|
||||||
<tr>
|
<tr>
|
||||||
<td>Default Location</td>
|
<td>Default Location</td>
|
||||||
<td>{{ part.default_location.pathstring }}</td>
|
<td><a href="{% url 'stock-location-detail' part.default_location.id %}">{{ part.default_location.pathstring }}</a></td>
|
||||||
</tr>
|
</tr>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% if part.default_supplier %}
|
{% if part.default_supplier %}
|
||||||
<tr>
|
<tr>
|
||||||
<td>Default Supplier</td>
|
<td>Default Supplier</td>
|
||||||
<td>{{ part.default_supplier.supplier.name }} | {{ part.default_supplier.SKU }}</td>
|
<td><a href="{% url 'supplier-part-detail' part.default_supplier.id %}">
|
||||||
|
{{ part.default_supplier.supplier.name }} | {{ part.default_supplier.SKU }}
|
||||||
|
</a></td>
|
||||||
</tr>
|
</tr>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
<tr>
|
<tr>
|
||||||
|
@ -16,7 +16,7 @@
|
|||||||
{% for spart in part.supplier_parts.all %}
|
{% for spart in part.supplier_parts.all %}
|
||||||
<tr>
|
<tr>
|
||||||
<td><a href="{% url 'supplier-part-detail' spart.id %}">{{ spart.SKU }}</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><a href="{% url 'company-detail' spart.supplier.id %}">{{ spart.supplier.name }}</a></td>
|
||||||
<td>
|
<td>
|
||||||
{% if spart.manufacturer %}{{ spart.manufacturer.name }}{% endif %}
|
{% if spart.manufacturer %}{{ spart.manufacturer.name }}{% endif %}
|
||||||
{% if spart.MPN %} | {{ spart.MPN }}{% endif %}
|
{% if spart.MPN %} | {{ spart.MPN }}{% endif %}
|
||||||
|
Loading…
Reference in New Issue
Block a user