mirror of
https://github.com/inventree/InvenTree.git
synced 2025-08-14 07:31:10 +00:00
Ability to delete part
- Provides confirmation form - Shows the flow-on effects (model.CASCADE) from deleting this part - Bootstrap makes it prettyful
This commit is contained in:
@@ -9,7 +9,8 @@
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
||||
|
||||
<!-- Bootstrap CSS -->
|
||||
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.0/css/bootstrap.min.css" integrity="sha384-9gVQ4dYFwwWSjIDZnLEWnxCjeSWFphJiwGPXr1jddIhOegiu1FwO5qRGvFXOdJZ4" crossorigin="anonymous">
|
||||
|
||||
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
|
||||
|
||||
<!-- Local stylesheet -->
|
||||
<link rel="stylesheet" href="{% static 'css/inventree.css' %}">
|
||||
@@ -31,7 +32,7 @@ InvenTree
|
||||
|
||||
{% include "navbar.html" %}
|
||||
|
||||
<div class="inventree-content">
|
||||
<div class="container-fluid inventree-content">
|
||||
{% block content %}
|
||||
<!-- Each view fills in here.. -->
|
||||
{% endblock %}
|
||||
|
@@ -1,2 +1,51 @@
|
||||
{% extends 'part/part_base.html' %}
|
||||
|
||||
{% block details %}
|
||||
|
||||
<div class="panel panel-danger">
|
||||
<div class="panel-heading">Are you sure you want to delete part '{{ part.name }}'?</div>
|
||||
<div class="panel-body">
|
||||
|
||||
<p><b>Deleting this part is a permanent action and cannot be undone.</b></p>
|
||||
|
||||
{% if part.usedInCount > 0 %}
|
||||
<p>This part is used in BOMs for {{ part.usedInCount }} 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>
|
||||
{% endfor %}
|
||||
</p>
|
||||
{% endif %}
|
||||
|
||||
{% if part.locations.all|length > 0 %}
|
||||
<p>There are {{ part.locations.all|length }} stock entries defined for this part. If you delete this part, the following stock entries will also be deleted:
|
||||
<ul class='list-group'>
|
||||
{% for stock in part.locations.all %}
|
||||
<li class='list-group-item'>{{ stock.location.name }} - {{ stock.quantity }} items</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
</p>
|
||||
{% endif %}
|
||||
|
||||
{% if part.supplier_parts.all|length > 0 %}
|
||||
<p>There are {{ part.supplier_parts.all|length }} suppliers defined for this part. If you delete this part, the following supplier parts will also be deleted.
|
||||
<ul class='list-group'>
|
||||
{% for spart in part.supplier_parts.all %}
|
||||
<li class='list-group-item'>{{ spart.supplier.name }} - {{ spart.SKU }}</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
</p>
|
||||
{% endif %}
|
||||
|
||||
{% if part.serials.all|length > 0 %}
|
||||
<p>There are {{ part.serials.all|length }} unique parts tracked for '{{ part.name }}'. Deleting this part will permanently remove this tracking information.</p>
|
||||
{% endif %}
|
||||
|
||||
<form action="" method="post">{% csrf_token %}
|
||||
<input type="submit" name='confirm' value="Confirm" />
|
||||
<input type="submit" name="cancel" value="Cancel" />
|
||||
</form>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
Reference in New Issue
Block a user