mirror of
https://github.com/inventree/InvenTree.git
synced 2025-12-16 01:08:12 +00:00
Improvements to stock page
- Fixed URL / view (use class views) - Better slug lookup - Better table rendering using ol' mate bootstrap
This commit is contained in:
51
InvenTree/stock/forms.py
Normal file
51
InvenTree/stock/forms.py
Normal file
@@ -0,0 +1,51 @@
|
||||
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',
|
||||
]
|
||||
Reference in New Issue
Block a user