2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-07-05 21:20:56 +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

@ -755,7 +755,7 @@ class StockItemSerialize(AjaxUpdateView):
model = StockItem
ajax_template_name = 'stock/item_serialize.html'
ajax_form_title = _('Serialize Stock')
#form_class = SerializeStockForm
form_class = SerializeStockForm
def get_form(self):
@ -774,16 +774,8 @@ class StockItemSerialize(AjaxUpdateView):
item = self.get_object()
# 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)
initials['quantity'] = item.quantity
initials['serial_numbers'] = sn
initials['serial_numbers'] = item.part.getSerialNumberString(item.quantity)
initials['destination'] = item.location.pk
return initials