2018-04-29 14:59:36 +00:00
|
|
|
# -*- coding: utf-8 -*-
|
|
|
|
from __future__ import unicode_literals
|
|
|
|
|
|
|
|
from InvenTree.forms import HelperForm
|
2018-04-14 15:18:12 +00:00
|
|
|
|
2018-04-15 11:29:24 +00:00
|
|
|
from .models import Part, PartCategory, BomItem
|
2018-04-22 11:54:12 +00:00
|
|
|
from .models import SupplierPart
|
2018-04-14 15:18:12 +00:00
|
|
|
|
|
|
|
|
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):
|
2018-04-14 15:18:12 +00:00
|
|
|
|
|
|
|
class Meta:
|
|
|
|
model = Part
|
|
|
|
fields = [
|
|
|
|
'category',
|
|
|
|
'name',
|
|
|
|
'description',
|
|
|
|
'IPN',
|
|
|
|
'URL',
|
2018-04-17 08:23:24 +00:00
|
|
|
'default_location',
|
|
|
|
'default_supplier',
|
2018-04-14 15:18:12 +00:00
|
|
|
'minimum_stock',
|
2018-04-16 12:13:31 +00:00
|
|
|
'buildable',
|
2018-04-14 15:18:12 +00:00
|
|
|
'trackable',
|
2018-04-15 14:30:57 +00:00
|
|
|
'purchaseable',
|
2018-04-17 08:11:34 +00:00
|
|
|
'salable',
|
2018-04-17 15:44:55 +00:00
|
|
|
'notes',
|
2018-04-29 14:59:36 +00:00
|
|
|
'image',
|
2018-04-15 01:40:03 +00:00
|
|
|
]
|
|
|
|
|
|
|
|
|
2018-04-29 14:59:36 +00:00
|
|
|
class EditCategoryForm(HelperForm):
|
2018-04-15 01:40:03 +00:00
|
|
|
|
|
|
|
class Meta:
|
|
|
|
model = PartCategory
|
|
|
|
fields = [
|
|
|
|
'parent',
|
|
|
|
'name',
|
|
|
|
'description'
|
2018-04-15 11:29:24 +00:00
|
|
|
]
|
|
|
|
|
|
|
|
|
2018-04-29 14:59:36 +00:00
|
|
|
class EditBomItemForm(HelperForm):
|
2018-04-15 11:29:24 +00:00
|
|
|
|
|
|
|
class Meta:
|
|
|
|
model = BomItem
|
|
|
|
fields = [
|
|
|
|
'part',
|
|
|
|
'sub_part',
|
|
|
|
'quantity'
|
2018-04-15 15:02:17 +00:00
|
|
|
]
|
2018-04-22 11:54:12 +00:00
|
|
|
|
|
|
|
|
2018-04-29 14:59:36 +00:00
|
|
|
class EditSupplierPartForm(HelperForm):
|
2018-04-22 11:54:12 +00:00
|
|
|
|
|
|
|
class Meta:
|
|
|
|
model = SupplierPart
|
|
|
|
fields = [
|
|
|
|
'supplier',
|
|
|
|
'SKU',
|
|
|
|
'part',
|
|
|
|
'description',
|
|
|
|
'URL',
|
|
|
|
'manufacturer',
|
|
|
|
'MPN',
|
|
|
|
]
|