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

Add view for BomItem model

- Create BOM item (auto-add to a parent part)
- Edit / delete
- View details
This commit is contained in:
Oliver
2018-04-15 21:29:24 +10:00
parent 0632609a80
commit 5861296974
10 changed files with 136 additions and 5 deletions

View File

@@ -2,7 +2,7 @@ from django import forms
from crispy_forms.helper import FormHelper
from crispy_forms.layout import Submit
from .models import Part, PartCategory
from .models import Part, PartCategory, BomItem
class EditPartForm(forms.ModelForm):
@@ -50,4 +50,26 @@ class EditCategoryForm(forms.ModelForm):
'parent',
'name',
'description'
]
class EditBomItemForm(forms.ModelForm):
def __init__(self, *args, **kwargs):
super(EditBomItemForm, self).__init__(*args, **kwargs)
self.helper = FormHelper()
self.helper.form_id = 'id-edit-part-form'
#self.helper.form_class = 'blueForms'
self.helper.form_method = 'post'
#self.helper.form_action = 'submit'
self.helper.add_input(Submit('submit', 'Submit'))
class Meta:
model = BomItem
fields = [
'part',
'sub_part',
'quantity'
]