2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-08-26 05:15:55 +00:00

ajax implementation for part import

This commit is contained in:
2021-05-26 13:05:20 +02:00
parent 421b0a896d
commit 79374c5dfd
6 changed files with 220 additions and 2 deletions

View File

@@ -41,7 +41,7 @@ from .models import PartSellPriceBreak
from common.models import InvenTreeSetting
from company.models import SupplierPart
from common.files import FileManager
from common.views import FileManagementFormView
from common.views import FileManagementFormView, FileManagementAjaxView
from stock.models import StockLocation
@@ -874,6 +874,17 @@ class PartImport(FileManagementFormView):
return HttpResponseRedirect(reverse('part-index'))
class PartImportAjax(FileManagementAjaxView, PartImport):
ajax_form_steps_template = [
'part/import_wizard/ajax_part_upload.html',
'part/import_wizard/ajax_match_fields.html',
'part/import_wizard/ajax_match_references.html',
]
def validate(self, obj, form, **kwargs):
return PartImport.validate(self, self.steps.current, form, **kwargs)
class PartNotes(UpdateView):
""" View for editing the 'notes' field of a Part object.
Presents a live markdown editor.