mirror of
https://github.com/inventree/InvenTree.git
synced 2026-11-28 02:28:43 +00:00
More modal forms
- supplier-part-edit - supplier-part-delete
This commit is contained in:
1 parent
bc3dca3aba
commit
e1e3cc71e6
6 files changed
+80
-33
No files matched your search
+8
-10
@@ -224,17 +224,21 @@ class SupplierPartDetail(DetailView):
|
||||
queryset = SupplierPart.objects.all()
|
||||
|
||||
|
||||
class SupplierPartEdit(UpdateView):
|
||||
class SupplierPartEdit(AjaxUpdateView):
|
||||
model = SupplierPart
|
||||
template_name = 'company/partedit.html'
|
||||
context_object_name = 'part'
|
||||
form_class = EditSupplierPartForm
|
||||
ajax_template_name = 'modal_form.html'
|
||||
ajax_form_title = 'Edit Supplier Part'
|
||||
|
||||
|
||||
class SupplierPartCreate(CreateView):
|
||||
class SupplierPartCreate(AjaxCreateView):
|
||||
model = SupplierPart
|
||||
form_class = EditSupplierPartForm
|
||||
template_name = 'company/partcreate.html'
|
||||
ajax_template_name = 'modal_form.html'
|
||||
ajax_form_title = 'Create new Supplier Part'
|
||||
#template_name = 'company/partcreate.html'
|
||||
context_object_name = 'part'
|
||||
|
||||
def get_initial(self):
|
||||
@@ -255,13 +259,7 @@ class SupplierPartCreate(CreateView):
|
||||
return initials
|
||||
|
||||
|
||||
class SupplierPartDelete(DeleteView):
|
||||
class SupplierPartDelete(AjaxDeleteView):
|
||||
model = SupplierPart
|
||||
success_url = '/supplier/'
|
||||
template_name = 'company/partdelete.html'
|
||||
|
||||
def post(self, request, *args, **kwargs):
|
||||
if 'confirm' in request.POST:
|
||||
return super(SupplierPartDelete, self).post(request, *args, **kwargs)
|
||||
else:
|
||||
return HttpResponseRedirect(self.get_object().get_absolute_url())
|
||||
Reference in new issue
Block a user