InvenTree/InvenTree/part/forms.py

76 lines
1.4 KiB
Python
Raw Normal View History

2018-04-29 14:59:36 +00:00
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from InvenTree.forms import HelperForm
from .models import Part, PartCategory, BomItem
from .models import SupplierPart
2018-04-29 14:59:36 +00:00
class PartImageForm(HelperForm):
2018-04-29 02:25:07 +00:00
class Meta:
model = Part
fields = [
'image',
]
2018-04-29 14:59:36 +00:00
class EditPartForm(HelperForm):
class Meta:
model = Part
fields = [
'category',
'name',
'description',
'IPN',
'URL',
'default_location',
'default_supplier',
'minimum_stock',
'buildable',
'trackable',
'purchaseable',
2018-04-17 08:11:34 +00:00
'salable',
'notes',
2018-04-29 14:59:36 +00:00
'image',
]
2018-04-29 14:59:36 +00:00
class EditCategoryForm(HelperForm):
class Meta:
model = PartCategory
fields = [
'parent',
'name',
'description'
]
2018-04-29 14:59:36 +00:00
class EditBomItemForm(HelperForm):
class Meta:
model = BomItem
fields = [
'part',
'sub_part',
'quantity'
2018-04-15 15:02:17 +00:00
]
2018-04-29 14:59:36 +00:00
class EditSupplierPartForm(HelperForm):
class Meta:
model = SupplierPart
fields = [
'supplier',
'SKU',
'part',
'description',
'URL',
'manufacturer',
'MPN',
]