2
0
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:
Oliver
2018-04-15 20:10:49 +10:00
parent ab4b91cd46
commit 9d89db34b2
17 changed files with 264 additions and 94 deletions

51
InvenTree/stock/forms.py Normal file
View 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',
]