From 8040ad8a6abf457b3fca98f63d09d9878009c103 Mon Sep 17 00:00:00 2001 From: Oliver Walters Date: Thu, 18 Apr 2019 23:28:46 +1000 Subject: [PATCH] Add function to duplicate stock item --- InvenTree/part/templates/part/part_base.html | 2 +- InvenTree/part/views.py | 2 +- InvenTree/stock/templates/stock/item.html | 14 ++++++++++++++ InvenTree/stock/views.py | 16 +++++++++++++++- 4 files changed, 31 insertions(+), 3 deletions(-) diff --git a/InvenTree/part/templates/part/part_base.html b/InvenTree/part/templates/part/part_base.html index 36283caeca..df19003b21 100644 --- a/InvenTree/part/templates/part/part_base.html +++ b/InvenTree/part/templates/part/part_base.html @@ -102,7 +102,7 @@ { follow: true, data: { - copy_part: {{ part.id }}, + copy: {{ part.id }}, }, } ); diff --git a/InvenTree/part/views.py b/InvenTree/part/views.py index 031bb3ed60..2778a6a806 100644 --- a/InvenTree/part/views.py +++ b/InvenTree/part/views.py @@ -78,7 +78,7 @@ class PartCreate(AjaxCreateView): def get_initial(self): # Is the client attempting to copy an existing part? - part_to_copy = self.request.GET.get('copy_part', None) + part_to_copy = self.request.GET.get('copy', None) if part_to_copy: try: diff --git a/InvenTree/stock/templates/stock/item.html b/InvenTree/stock/templates/stock/item.html index f1f0a5db1d..aee40d513d 100644 --- a/InvenTree/stock/templates/stock/item.html +++ b/InvenTree/stock/templates/stock/item.html @@ -13,6 +13,7 @@