From 6de58edd41c199d698d4f7a17d020425e9d240fb Mon Sep 17 00:00:00 2001 From: Oliver Walters Date: Thu, 18 Apr 2019 23:17:21 +1000 Subject: [PATCH] Add button on part page to duplicate part - Opens modal form - Takes user to created page --- InvenTree/part/templates/part/part_base.html | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/InvenTree/part/templates/part/part_base.html b/InvenTree/part/templates/part/part_base.html index c97423ed86..36283caeca 100644 --- a/InvenTree/part/templates/part/part_base.html +++ b/InvenTree/part/templates/part/part_base.html @@ -32,7 +32,7 @@ {{ part.URL }} {% endif %} - + @@ -95,4 +95,17 @@ } ); }); + + $("#duplicate-part").click(function() { + launchModalForm( + "{% url 'part-create' %}", + { + follow: true, + data: { + copy_part: {{ part.id }}, + }, + } + ); + }); + {% endblock %} \ No newline at end of file