From 05beb26c82c508114126c6557125d25809f54ffb Mon Sep 17 00:00:00 2001 From: Oliver Walters Date: Thu, 18 Apr 2019 23:22:58 +1000 Subject: [PATCH] Change form title if part is being copied --- InvenTree/part/views.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/InvenTree/part/views.py b/InvenTree/part/views.py index 38e26468f4..031bb3ed60 100644 --- a/InvenTree/part/views.py +++ b/InvenTree/part/views.py @@ -50,8 +50,7 @@ class PartCreate(AjaxCreateView): """ model = Part form_class = EditPartForm - template_name = 'part/create.html' - + ajax_form_title = 'Create new part' ajax_template_name = 'modal_form.html' @@ -85,6 +84,7 @@ class PartCreate(AjaxCreateView): try: original = Part.objects.get(pk=part_to_copy) initials = model_to_dict(original) + self.ajax_form_title = "Copy Part '{p}'".format(p=original.name) except Part.DoesNotExist: initials = super(PartCreate, self).get_initial()