2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-04-29 12:06:44 +00:00
Oliver 9d89db34b2 Improvements to stock page
- Fixed URL / view (use class views)
- Better slug lookup
- Better table rendering using ol' mate bootstrap
2018-04-15 20:10:49 +10:00

51 lines
1.3 KiB
Python

from django import forms
from crispy_forms.helper import FormHelper
from crispy_forms.layout import Submit
from .models import StockLocation, StockItem
class EditStockLocationForm(forms.ModelForm):
def __init__(self, *args, **kwargs):
super(EditStockLocationForm, 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 = StockLocation
fields = [
'name',
'parent',
'description'
]
class EditStockItemForm(forms.ModelForm):
def __init__(self, *args, **kwargs):
super(EditStockItemForm, 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 = StockItem
fields = [
'part',
'supplier_part',
'location',
'quantity',
]