mirror of
https://github.com/inventree/InvenTree.git
synced 2025-08-14 15:41:10 +00:00
Add a 'full_name' field for Part
- Combines IPN | Name | Variant - Use this to display in most views
This commit is contained in:
@@ -17,7 +17,7 @@
|
||||
{% for allocation in part.build_allocation %}
|
||||
<tr>
|
||||
<td><a href="{% url 'build-detail' allocation.build.id %}">{{ allocation.build.title }}</a></td>
|
||||
<td>{{ allocation.build.quantity }} × <a href="{% url 'part-detail' allocation.build.part.id %}">{{ allocation.build.part.name }}</a></td>
|
||||
<td>{{ allocation.build.quantity }} × <a href="{% url 'part-detail' allocation.build.part.id %}">{{ allocation.build.part.full_name }}</a></td>
|
||||
<td>{{ allocation.quantity }}</td>
|
||||
<td>{% include "build_status.html" with build=allocation.build %}</td>
|
||||
</tr>
|
||||
|
@@ -4,6 +4,6 @@ Deleting this entry will remove the BOM row from the following part:
|
||||
|
||||
<ul class='list-group'>
|
||||
<li class='list-group-item'>
|
||||
<b>{{ item.part.name }}</b> - <i>{{ item.part.description }}</i>
|
||||
<b>{{ item.part.full_name }}</b> - <i>{{ item.part.description }}</i>
|
||||
</li>
|
||||
</ul>
|
||||
|
@@ -4,8 +4,8 @@
|
||||
|
||||
<h3>BOM Item</h3>
|
||||
<table class="table table-striped">
|
||||
<tr><td>Parent</td><td><a href="{% url 'part-bom' item.part.id %}">{{ item.part.name }}</a></td></tr>
|
||||
<tr><td>Child</td><td><a href="{% url 'part-used-in' item.sub_part.id %}">{{ item.sub_part.name }}</a></td></tr>
|
||||
<tr><td>Parent</td><td><a href="{% url 'part-bom' item.part.id %}">{{ item.part.full_name }}</a></td></tr>
|
||||
<tr><td>Child</td><td><a href="{% url 'part-used-in' item.sub_part.id %}">{{ item.sub_part.full_name }}</a></td></tr>
|
||||
<tr><td>Quantity</td><td>{{ item.quantity }}</td></tr>
|
||||
</table>
|
||||
|
||||
|
@@ -27,7 +27,7 @@ the top level 'Parts' category.
|
||||
</p>
|
||||
<ul class='list-group'>
|
||||
{% for part in category.parts.all %}
|
||||
<li class='list-group-item'><b>{{ part.long_name }}</b> - <i>{{ part.description }}</i></li>
|
||||
<li class='list-group-item'><b>{{ part.full_name }}</b> - <i>{{ part.description }}</i></li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
{% endif %}
|
@@ -10,7 +10,7 @@
|
||||
<ul class='list-group'>
|
||||
{% for match in matches %}
|
||||
<li class='list-group-item list-group-item-condensed'>
|
||||
{{ match.part.name }} - <i>{{ match.part.description }}</i> ({{ match.ratio }}%)
|
||||
{{ match.part.full_name }} - <i>{{ match.part.description }}</i> ({{ match.ratio }}%)
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
|
@@ -16,7 +16,6 @@
|
||||
{% if part.active %}
|
||||
<li><a href='#' id='duplicate-part' title='Duplicate Part'>Duplicate</a></li>
|
||||
<li><a href="#" id='edit-part' title='Edit part'>Edit</a></li>
|
||||
<li><a href='#' id='stocktake-part' title='Stocktake'>Stocktake</a></li>
|
||||
<hr>
|
||||
<li><a href="#" id='deactivate-part' title='Deactivate part'>Deactivate</a></li>
|
||||
{% else %}
|
||||
@@ -34,7 +33,7 @@
|
||||
<table class='table table-striped'>
|
||||
<tr>
|
||||
<td>Part name</td>
|
||||
<td>{{ part.long_name }}</td>
|
||||
<td>{{ part.full_name }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Description</td>
|
||||
@@ -46,6 +45,12 @@
|
||||
<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>Category</td>
|
||||
<td>
|
||||
@@ -147,7 +152,7 @@
|
||||
$('#activate-part').click(function() {
|
||||
showQuestionDialog(
|
||||
'Activate Part?',
|
||||
'Are you sure you wish to reactivate {{ part.long_name }}?',
|
||||
'Are you sure you wish to reactivate {{ part.full_name }}?',
|
||||
{
|
||||
accept_text: 'Activate',
|
||||
accept: function() {
|
||||
@@ -169,7 +174,7 @@
|
||||
$('#deactivate-part').click(function() {
|
||||
showQuestionDialog(
|
||||
'Deactivate Part?',
|
||||
`Are you sure you wish to deactivate {{ part.long_name }}?<br>
|
||||
`Are you sure you wish to deactivate {{ part.full_name }}?<br>
|
||||
`,
|
||||
{
|
||||
accept_text: 'Deactivate',
|
||||
@@ -198,16 +203,4 @@
|
||||
});
|
||||
});
|
||||
|
||||
$('#stocktake-part').click(function() {
|
||||
adjustStock({
|
||||
action: 'stocktake',
|
||||
query: {
|
||||
part: {{ part.id }},
|
||||
},
|
||||
success: function() {
|
||||
location.reload();
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
{% endblock %}
|
||||
|
@@ -4,7 +4,7 @@
|
||||
|
||||
{% block page_title %}
|
||||
{% if part %}
|
||||
InvenTree | Part - {{ part.long_name }}
|
||||
InvenTree | Part - {{ part.full_name }}
|
||||
{% elif category %}
|
||||
InvenTree | Part Category - {{ category }}
|
||||
{% else %}
|
||||
|
@@ -7,7 +7,7 @@
|
||||
<div class="row">
|
||||
{% if part.active == False %}
|
||||
<div class='alert alert-danger' style='display: block;'>
|
||||
This part ({{ part.long_name }}) is not active:
|
||||
This part ({{ part.full_name }}) is not active:
|
||||
</div>
|
||||
{% endif %}
|
||||
<div class="col-sm-6">
|
||||
@@ -24,7 +24,7 @@
|
||||
</div>
|
||||
<div class="media-body">
|
||||
<h4>
|
||||
{{ part.long_name }}
|
||||
{{ part.full_name }}
|
||||
</h4>
|
||||
{% if part.variant %}
|
||||
<p>Variant: {{ part.variant }}</p>
|
||||
|
@@ -1,10 +1,10 @@
|
||||
Are you sure you want to delete part '{{ part.long_name }}'?
|
||||
Are you sure you want to delete part '{{ part.full_name }}'?
|
||||
|
||||
{% if part.used_in_count %}
|
||||
<p>This part is used in BOMs for {{ part.used_in_count }} other parts. If you delete this part, the BOMs for the following parts will be updated:
|
||||
<ul class="list-group">
|
||||
{% for child in part.used_in.all %}
|
||||
<li class='list-group-item'>{{ child.part.name }} - {{ child.part.description }}</li>
|
||||
<li class='list-group-item'>{{ child.part.full_name }} - {{ child.part.description }}</li>
|
||||
{% endfor %}
|
||||
</p>
|
||||
{% endif %}
|
||||
@@ -30,5 +30,5 @@ Are you sure you want to delete part '{{ part.long_name }}'?
|
||||
{% endif %}
|
||||
|
||||
{% if part.serials.all|length > 0 %}
|
||||
<p>There are {{ part.serials.all|length }} unique parts tracked for '{{ part.long_name }}'. Deleting this part will permanently remove this tracking information.</p>
|
||||
<p>There are {{ part.serials.all|length }} unique parts tracked for '{{ part.full_name }}'. Deleting this part will permanently remove this tracking information.</p>
|
||||
{% endif %}
|
@@ -48,7 +48,7 @@
|
||||
$("#supplier-table").bootstrapTable({
|
||||
sortable: true,
|
||||
search: true,
|
||||
formatNoMatches: function() { return "No supplier parts available for {{ part.long_name }}"; },
|
||||
formatNoMatches: function() { return "No supplier parts available for {{ part.full_name }}"; },
|
||||
queryParams: function(p) {
|
||||
return {
|
||||
part: {{ part.id }}
|
||||
|
@@ -4,7 +4,7 @@
|
||||
|
||||
{% include 'part/tabs.html' with tab='track' %}
|
||||
|
||||
Part tracking for {{ part.long_name }}
|
||||
Part tracking for {{ part.full_name }}
|
||||
|
||||
<table class="table table-striped">
|
||||
<tr>
|
||||
|
@@ -27,7 +27,7 @@
|
||||
$("#used-table").bootstrapTable({
|
||||
sortable: true,
|
||||
search: true,
|
||||
formatNoMatches: function() { return "{{ part.long_name }} is not used to make any other parts"; },
|
||||
formatNoMatches: function() { return "{{ part.full_name }} is not used to make any other parts"; },
|
||||
queryParams: function(p) {
|
||||
return {
|
||||
sub_part: {{ part.id }}
|
||||
@@ -43,7 +43,7 @@
|
||||
field: 'part_detail',
|
||||
title: 'Part',
|
||||
formatter: function(value, row, index, field) {
|
||||
return imageHoverIcon(row.part_detail.image_url) + renderLink(value.name, value.url + 'bom/');
|
||||
return imageHoverIcon(row.part_detail.image_url) + renderLink(value.full_name, value.url + 'bom/');
|
||||
}
|
||||
},
|
||||
{
|
||||
|
Reference in New Issue
Block a user