2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-06-19 05:25:42 +00:00

Generate modal form to export BOM

- Doesn't do anything yet
- Extends AjaxView
This commit is contained in:
Oliver Walters
2019-04-13 21:04:23 +10:00
parent 73b7c178d4
commit 0cc59540ef
4 changed files with 44 additions and 1 deletions

View File

@ -18,7 +18,7 @@ from .forms import EditBomItemForm
from .forms import EditSupplierPartForm
from InvenTree.views import AjaxCreateView, AjaxUpdateView, AjaxDeleteView
from InvenTree.views import AjaxView, AjaxCreateView, AjaxUpdateView, AjaxDeleteView
class PartIndex(ListView):
@ -110,6 +110,28 @@ class PartEdit(AjaxUpdateView):
ajax_form_title = 'Edit Part Properties'
class BomExport(AjaxView):
model = Part
template_name = 'part/bom_export.html'
#ajax_template_name = 'modal_form.html'
ajax_form_title = 'Export Bill of Materials'
ajax_submit_text = 'Export'
context_object_name = 'part'
fields = []
def post(self, request, *args, **kwargs):
part = get_object_or_404(Part, pk=self.kwargs['pk'])
return self.renderJsonResponse(request, None)
def get_data(self):
return {
'info': 'Exported BOM'
}
class PartDelete(AjaxDeleteView):
model = Part
template_name = 'part/delete.html'