mirror of
https://github.com/inventree/InvenTree.git
synced 2025-04-29 20:16:44 +00:00
Improved delete form to show supplier parts deletion
This commit is contained in:
parent
bd65a42410
commit
76fe535ef9
@ -97,9 +97,9 @@ class EditManufacturerPartForm(HelperForm):
|
|||||||
model = ManufacturerPart
|
model = ManufacturerPart
|
||||||
fields = [
|
fields = [
|
||||||
'part',
|
'part',
|
||||||
'description',
|
|
||||||
'manufacturer',
|
'manufacturer',
|
||||||
'MPN',
|
'MPN',
|
||||||
|
'description',
|
||||||
'link',
|
'link',
|
||||||
]
|
]
|
||||||
|
|
||||||
|
@ -2,14 +2,19 @@
|
|||||||
{% load i18n %}
|
{% load i18n %}
|
||||||
|
|
||||||
{% block pre_form_content %}
|
{% block pre_form_content %}
|
||||||
{% trans "Are you sure you want to delete the following Manufacturer Parts?" %}
|
<div class='alert alert-block alert-warning'>
|
||||||
|
{% trans "Are you sure you want to delete the following Manufacturer Parts?" %}
|
||||||
|
</div>
|
||||||
|
{% for part in parts %}
|
||||||
|
|
||||||
|
{% endfor %}
|
||||||
|
|
||||||
<hr>
|
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
{% block form_data %}
|
{% block form_data %}
|
||||||
<table class='table table-striped table-condensed'>
|
|
||||||
{% for part in parts %}
|
{% for part in parts %}
|
||||||
|
<table class='table table-striped table-condensed'>
|
||||||
<tr>
|
<tr>
|
||||||
<input type='hidden' name='manufacturer-part-{{ part.id}}' value='manufacturer-part-{{ part.id }}'/>
|
<input type='hidden' name='manufacturer-part-{{ part.id}}' value='manufacturer-part-{{ part.id }}'/>
|
||||||
|
|
||||||
@ -25,7 +30,18 @@
|
|||||||
{{ part.MPN }}
|
{{ part.MPN }}
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
{% endfor %}
|
|
||||||
</table>
|
</table>
|
||||||
|
{% if part.supplier_parts.all|length > 0 %}
|
||||||
|
<div class='alert alert-block alert-danger'>
|
||||||
|
<p>There are {{ part.supplier_parts.all|length }} suppliers defined for this manufacturer part. If you delete it, the following supplier parts will also be deleted:
|
||||||
|
</p>
|
||||||
|
<ul class='list-group' style='margin-top:10px'>
|
||||||
|
{% for spart in part.supplier_parts.all %}
|
||||||
|
<li class='list-group-item'>{{ spart.supplier.name }} - {{ spart.SKU }}</li>
|
||||||
|
{% endfor %}
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
{% endif %}
|
||||||
|
{% endfor %}
|
||||||
|
|
||||||
{% endblock %}
|
{% endblock %}
|
Loading…
x
Reference in New Issue
Block a user