mirror of
https://github.com/inventree/InvenTree.git
synced 2025-04-30 20:46:47 +00:00
Do not enforce serialization when creating a stock item
This commit is contained in:
parent
614363fa03
commit
88b90281f5
@ -7,6 +7,7 @@ from __future__ import unicode_literals
|
|||||||
|
|
||||||
from django import forms
|
from django import forms
|
||||||
from django.forms.utils import ErrorDict
|
from django.forms.utils import ErrorDict
|
||||||
|
from django.utils.translation import ugettext as _
|
||||||
|
|
||||||
from InvenTree.forms import HelperForm
|
from InvenTree.forms import HelperForm
|
||||||
from .models import StockLocation, StockItem, StockItemTracking
|
from .models import StockLocation, StockItem, StockItemTracking
|
||||||
@ -27,7 +28,7 @@ class EditStockLocationForm(HelperForm):
|
|||||||
class CreateStockItemForm(HelperForm):
|
class CreateStockItemForm(HelperForm):
|
||||||
""" Form for creating a new StockItem """
|
""" Form for creating a new StockItem """
|
||||||
|
|
||||||
serial_numbers = forms.CharField(label='Serial numbers', required=False, help_text='Enter unique serial numbers')
|
serial_numbers = forms.CharField(label='Serial numbers', required=False, help_text=_('Enter unique serial numbers (or leave blank)'))
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
model = StockItem
|
model = StockItem
|
||||||
|
@ -593,6 +593,10 @@ class StockItemCreate(AjaxCreateView):
|
|||||||
if part.trackable:
|
if part.trackable:
|
||||||
sn = request.POST.get('serial_numbers', '')
|
sn = request.POST.get('serial_numbers', '')
|
||||||
|
|
||||||
|
sn = str(sn).strip()
|
||||||
|
|
||||||
|
# If user has specified a range of serial numbers
|
||||||
|
if len(sn) > 0:
|
||||||
try:
|
try:
|
||||||
serials = ExtractSerialNumbers(sn, quantity)
|
serials = ExtractSerialNumbers(sn, quantity)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user