mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
Pass object data back to modal when creating new object
This commit is contained in:
parent
21c238e96a
commit
a316681ec8
@ -245,6 +245,7 @@ class AjaxCreateView(AjaxMixin, CreateView):
|
||||
|
||||
# Return the PK of the newly-created object
|
||||
data['pk'] = obj.pk
|
||||
data['text'] = str(obj)
|
||||
|
||||
try:
|
||||
data['url'] = obj.get_absolute_url()
|
||||
|
@ -202,6 +202,7 @@ class PartDuplicate(AjaxCreateView):
|
||||
part = form.save()
|
||||
|
||||
data['pk'] = part.pk
|
||||
data['text'] = str(part)
|
||||
|
||||
deep_copy = str2bool(request.POST.get('deep_copy', False))
|
||||
|
||||
@ -321,6 +322,7 @@ class PartCreate(AjaxCreateView):
|
||||
part = form.save()
|
||||
|
||||
data['pk'] = part.pk
|
||||
data['text'] = str(part)
|
||||
|
||||
try:
|
||||
data['url'] = part.get_absolute_url()
|
||||
|
Loading…
Reference in New Issue
Block a user