mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
Add param tab to Part detail view
This commit is contained in:
parent
0955166fae
commit
6393ddad53
@ -971,6 +971,11 @@ class Part(models.Model):
|
||||
|
||||
return sum([part.on_order() for part in self.supplier_parts.all().prefetch_related('purchase_order_line_items')])
|
||||
|
||||
def get_parameters(self):
|
||||
""" Return all parameters for this part, ordered by name """
|
||||
|
||||
return self.parameters.order_by('name')
|
||||
|
||||
|
||||
def attach_file(instance, filename):
|
||||
""" Function for storing a file for a PartAttachment
|
||||
|
@ -2,6 +2,9 @@
|
||||
<li{% ifequal tab 'detail' %} class="active"{% endifequal %}>
|
||||
<a href="{% url 'part-detail' part.id %}">Details</a>
|
||||
</li>
|
||||
<li{% ifequal tab 'params' %} class='active'{% endifequal %}>
|
||||
<a href="{% url 'part-params' part.id %}">Parameters <span class='badge'>{{ part.parameters.count }}</span></a>
|
||||
</li>
|
||||
{% if part.is_template %}
|
||||
<li{% ifequal tab 'variants' %} class='active'{% endifequal %}>
|
||||
<a href="{% url 'part-variants' part.id %}">Variants <span class='badge'>{{ part.variants.count }}</span></span></a>
|
||||
|
Loading…
Reference in New Issue
Block a user