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

PEP fixes

This commit is contained in:
Oliver Walters
2020-05-16 17:52:25 +10:00
parent a6ad263ee7
commit 8a99062704
6 changed files with 26 additions and 44 deletions

View File

@@ -9,9 +9,6 @@ from django import forms
from django.forms.utils import ErrorDict
from django.utils.translation import ugettext as _
from crispy_forms.layout import Field, Layout
from crispy_forms.bootstrap import PrependedText
from mptt.fields import TreeNodeChoiceField
from InvenTree.helpers import GetExportFormats
@@ -111,23 +108,7 @@ class SerializeStockForm(HelperForm):
item = kwargs.pop('item', None)
if item:
# Pre-calculate what the serial numbers should be!
sn = item.part.getNextSerialNumber()
if item.quantity >= 2:
sn = "{n}-{m}".format(n=sn, m=int(sn+item.quantity-1))
else:
sn = str(sn)
self.field_placeholder = {
'serial_numbers': sn
}
self.field_prefix = {
'serial_numbers': 'fa-hashtag',
}
self.field_placeholder['serial_numbers'] = item.part.getSerialNumberString(item.quantity)
super().__init__(*args, **kwargs)