mirror of
https://github.com/inventree/InvenTree.git
synced 2025-08-14 15:41:10 +00:00
Add new view to duplicate a part
- Allows 'deep_copy' (copies all BOM items for the duplicated part)
This commit is contained in:
24
InvenTree/part/templates/part/copy_part.html
Normal file
24
InvenTree/part/templates/part/copy_part.html
Normal file
@@ -0,0 +1,24 @@
|
||||
{% extends "modal_form.html" %}
|
||||
|
||||
{% block pre_form_content %}
|
||||
|
||||
{{ block.super }}
|
||||
|
||||
<div class='alert alert-info alert-block'>
|
||||
<b>Duplicate Part</b><br>
|
||||
Make a copy of part '{{ part.full_name }}'.
|
||||
</div>
|
||||
|
||||
{% if matches %}
|
||||
<b>Possible Matching Parts</b>
|
||||
<p>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'>
|
||||
{{ match.part.full_name }} - <i>{{ match.part.description }}</i> ({{ match.ratio }}%)
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
{% endif %}
|
||||
|
||||
{% endblock %}
|
@@ -131,12 +131,9 @@
|
||||
|
||||
$("#duplicate-part").click(function() {
|
||||
launchModalForm(
|
||||
"{% url 'part-create' %}",
|
||||
"{% url 'part-duplicate' part.id %}",
|
||||
{
|
||||
follow: true,
|
||||
data: {
|
||||
copy: {{ part.id }},
|
||||
},
|
||||
}
|
||||
);
|
||||
});
|
||||
|
Reference in New Issue
Block a user