2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-06-19 21:45:39 +00:00

Modal form for part creation

This commit is contained in:
Oliver
2018-04-26 18:22:41 +10:00
parent d02b6f3583
commit 280f2c36cb
5 changed files with 34 additions and 30 deletions

View File

@ -41,7 +41,7 @@ class PartIndex(ListView):
return context
class PartCreate(CreateView):
class PartCreate(AjaxCreateView):
""" Create a new part
- Optionally provide a category object as initial data
"""
@ -49,6 +49,9 @@ class PartCreate(CreateView):
form_class = EditPartForm
template_name = 'part/create.html'
ajax_form_title = 'Create new part'
ajax_template_name = 'modal_form.html'
def get_category_id(self):
return self.request.GET.get('category', None)