mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
Change form title if part is being copied
This commit is contained in:
parent
6de58edd41
commit
05beb26c82
@ -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()
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user