mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
Cleanup
This commit is contained in:
parent
697a338700
commit
526d81481b
@ -1856,9 +1856,6 @@ class BomItem(models.Model):
|
||||
self.clean()
|
||||
super().save(*args, **kwargs)
|
||||
|
||||
def get_absolute_url(self):
|
||||
return reverse('bom-item-detail', kwargs={'pk': self.id})
|
||||
|
||||
# A link to the parent part
|
||||
# Each part will get a reverse lookup field 'bom_items'
|
||||
part = models.ForeignKey(Part, on_delete=models.CASCADE, related_name='bom_items',
|
||||
|
@ -1,10 +1,11 @@
|
||||
{% load i18n %}
|
||||
{% extends "modal_delete_form.html" %}
|
||||
|
||||
{% block pre_form_content %}
|
||||
|
||||
Are you sure you want to delete this BOM item?
|
||||
{% trans "Are you sure you want to delete this BOM item?" %}
|
||||
<br>
|
||||
Deleting this entry will remove the BOM row from the following part:
|
||||
{% trans "Deleting this entry will remove the BOM row from the following part" %}:
|
||||
|
||||
<ul class='list-group'>
|
||||
<li class='list-group-item'>
|
||||
|
@ -1,18 +0,0 @@
|
||||
{% extends "base.html" %}
|
||||
|
||||
{% block content %}
|
||||
|
||||
<h3>BOM Item</h3>
|
||||
<table class="table table-striped">
|
||||
<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>
|
||||
|
||||
<div class='container-fluid'>
|
||||
<a href="{% url 'bom-item-edit' item.id %}"><button class="btn btn-info">Edit BOM item</button></a>
|
||||
|
||||
<a href="{% url 'bom-item-delete' item.id %}"><button class="btn btn-danger">Delete BOM item</button></a>
|
||||
</div>
|
||||
|
||||
{% endblock %}
|
@ -63,10 +63,10 @@
|
||||
<span class='fas fa-file-download'></span> {% trans "Export" %}
|
||||
</button>
|
||||
{% endif %}
|
||||
</div>
|
||||
<div class='filter-list' id='filter-list-bom'>
|
||||
<!-- Empty div (will be filled out with avilable BOM filters) -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<table class='table table-striped table-condensed' data-toolbar="#button-toolbar" id='bom-table'>
|
||||
@ -179,8 +179,8 @@
|
||||
secondary: [
|
||||
{
|
||||
field: 'sub_part',
|
||||
label: 'New Part',
|
||||
title: 'Create New Part',
|
||||
label: '{% trans "New Part" %}',
|
||||
title: '{% trans "Create New Part" %}',
|
||||
url: "{% url 'part-create' %}",
|
||||
},
|
||||
]
|
||||
|
@ -49,14 +49,14 @@
|
||||
{% for row in bom_rows %}
|
||||
<tr {% if row.errors %} style='background: #ffeaea;'{% endif %} part-name='{{ row.part_name }}' part-description='{{ row.description }}' part-select='#select_part_{{ row.index }}'>
|
||||
<td>
|
||||
<button class='btn btn-default btn-remove' onClick='removeRowFromBomWizard()' id='del_row_{{ forloop.counter }}' style='display: inline; float: right;' title='Remove row'>
|
||||
<button class='btn btn-default btn-remove' onClick='removeRowFromBomWizard()' id='del_row_{{ forloop.counter }}' style='display: inline; float: right;' title='{% trans "Remove row" %}'>
|
||||
<span row_id='{{ forloop.counter }}' class='fas fa-trash-alt icon-red'></span>
|
||||
</button>
|
||||
</td>
|
||||
<td></td>
|
||||
<td>{% add row.index 1 %}</td>
|
||||
<td>
|
||||
<button class='btn btn-default btn-create' onClick='newPartFromBomWizard()' id='new_part_row_{{ row.index }}' title='Create new part' type='button'>
|
||||
<button class='btn btn-default btn-create' onClick='newPartFromBomWizard()' id='new_part_row_{{ row.index }}' title='{% trans "Create new part" %}' type='button'>
|
||||
<span row_id='{{ row.index }}' class='fas fa-plus icon-green'/>
|
||||
</button>
|
||||
<select class='select bomselect' id='select_part_{{ row.index }}' name='part_{{ row.index }}'>
|
||||
|
@ -126,10 +126,10 @@
|
||||
<li><a href='#' id='multi-part-export' title='{% trans "Export" %}'>{% trans "Export Data" %}</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class='filter-list' id='filter-list-parts'>
|
||||
<!-- Empty div -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
@ -1,3 +1,4 @@
|
||||
{% load i18n %}
|
||||
{% extends "modal_form.html" %}
|
||||
|
||||
{% block pre_form_content %}
|
||||
@ -10,8 +11,8 @@
|
||||
</div>
|
||||
|
||||
{% if matches %}
|
||||
<b>Possible Matching Parts</b>
|
||||
<p>The new part may be a duplicate of these existing parts:</p>
|
||||
<b>{% trans "Possible Matching Parts" %}</b>
|
||||
<p>{% trans "The new part may be a duplicate of these existing parts" %}:</p>
|
||||
<ul class='list-group'>
|
||||
{% for match in matches %}
|
||||
<li class='list-group-item list-group-item-condensed'>
|
||||
|
@ -1,3 +1,4 @@
|
||||
{% load i18n %}
|
||||
{% extends "modal_form.html" %}
|
||||
|
||||
{% block pre_form_content %}
|
||||
@ -5,8 +6,8 @@
|
||||
{{ block.super }}
|
||||
|
||||
<div class='alert alert-info alert-block'>
|
||||
<b>Create new part variant</b><br>
|
||||
Create a new variant of template <i>'{{ part.full_name }}'</i>.
|
||||
<b>{% trans "Create new part variant" %}</b><br>
|
||||
{% trans "Create a new variant of template" %} <i>'{{ part.full_name }}'</i>.
|
||||
</div>
|
||||
|
||||
{% endblock %}
|
@ -99,8 +99,6 @@ part_category_urls = [
|
||||
part_bom_urls = [
|
||||
url(r'^edit/?', views.BomItemEdit.as_view(), name='bom-item-edit'),
|
||||
url('^delete/?', views.BomItemDelete.as_view(), name='bom-item-delete'),
|
||||
|
||||
url(r'^.*$', views.BomItemDetail.as_view(), name='bom-item-detail'),
|
||||
]
|
||||
|
||||
# URL list for part web interface
|
||||
|
@ -2411,15 +2411,6 @@ class CategoryParameterTemplateDelete(AjaxDeleteView):
|
||||
return self.object
|
||||
|
||||
|
||||
class BomItemDetail(InvenTreeRoleMixin, DetailView):
|
||||
""" Detail view for BomItem """
|
||||
context_object_name = 'item'
|
||||
queryset = BomItem.objects.all()
|
||||
template_name = 'part/bom-detail.html'
|
||||
|
||||
role_required = 'part.view'
|
||||
|
||||
|
||||
class BomItemCreate(AjaxCreateView):
|
||||
""" Create view for making a new BomItem object """
|
||||
model = BomItem
|
||||
|
@ -214,7 +214,6 @@ function loadBomTable(table, options) {
|
||||
},
|
||||
});
|
||||
|
||||
if (!options.editable) {
|
||||
cols.push(
|
||||
{
|
||||
field: 'sub_part_detail.stock',
|
||||
@ -254,7 +253,6 @@ function loadBomTable(table, options) {
|
||||
}
|
||||
});
|
||||
*/
|
||||
}
|
||||
|
||||
cols.push(
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user