2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-12-15 08:48:11 +00:00

Merged master

This commit is contained in:
eeintech
2021-01-07 13:50:29 -05:00
145 changed files with 23900 additions and 2396 deletions

View File

@@ -16,6 +16,7 @@ from mptt.fields import TreeNodeChoiceField
from InvenTree.helpers import GetExportFormats
from InvenTree.forms import HelperForm
from InvenTree.fields import RoundingDecimalFormField
from InvenTree.fields import DatePickerFormField
from report.models import TestReport
@@ -109,6 +110,10 @@ class ConvertStockItemForm(HelperForm):
class CreateStockItemForm(HelperForm):
""" Form for creating a new StockItem """
expiry_date = DatePickerFormField(
help_text=('Expiration date for this stock item'),
)
serial_numbers = forms.CharField(label=_('Serial numbers'), required=False, help_text=_('Enter unique serial numbers (or leave blank)'))
def __init__(self, *args, **kwargs):
@@ -130,6 +135,7 @@ class CreateStockItemForm(HelperForm):
'batch',
'serial_numbers',
'purchase_price',
'expiry_date',
'link',
'delete_on_deplete',
'status',
@@ -243,7 +249,7 @@ class TestReportFormatForm(HelperForm):
templates = TestReport.objects.filter(enabled=True)
for template in templates:
if template.matches_stock_item(self.stock_item):
if template.enabled and template.matches_stock_item(self.stock_item):
choices.append((template.pk, template))
return choices
@@ -394,6 +400,10 @@ class EditStockItemForm(HelperForm):
part - Cannot be edited after creation
"""
expiry_date = DatePickerFormField(
help_text=('Expiration date for this stock item'),
)
class Meta:
model = StockItem
@@ -402,6 +412,7 @@ class EditStockItemForm(HelperForm):
'serial',
'batch',
'status',
'expiry_date',
'purchase_price',
'link',
'delete_on_deplete',