2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-07-16 01:36:29 +00:00

Modal for company create

- Ajax modals now return the URL of the item they are operating on
- passing {follow: true} to the modal caller will go to that URL on success
- footable'd company list
This commit is contained in:
Oliver
2018-04-27 21:58:22 +10:00
parent c4e305bde6
commit 36cf946a78
5 changed files with 52 additions and 23 deletions

View File

@@ -54,6 +54,8 @@ class AjaxCreateView(AjaxView, CreateView):
# Return the PK of the newly-created object
data['pk'] = obj.pk
data['url'] = obj.get_absolute_url()
return self.renderJsonResponse(request, form, data)
else:
@@ -84,6 +86,9 @@ class AjaxUpdateView(AjaxView, UpdateView):
if form.is_valid():
obj = form.save()
data['pk'] = obj.id
data['url'] = obj.get_absolute_url()
return self.renderJsonResponse(request, form, data)
else: