mirror of
https://github.com/inventree/InvenTree.git
synced 2025-06-20 13:56:30 +00:00
PEP fixes
This commit is contained in:
@ -308,6 +308,24 @@ class Part(MPTTModel):
|
||||
else:
|
||||
return n + 1
|
||||
|
||||
def getSerialNumberString(self, quantity):
|
||||
"""
|
||||
Return a formatted string representing the next available serial numbers,
|
||||
given a certain quantity of items.
|
||||
"""
|
||||
|
||||
sn = self.getNextSerialNumber()
|
||||
|
||||
if quantity >= 2:
|
||||
sn = "{n}-{m}".format(
|
||||
n=sn,
|
||||
m=int(sn + quantity - 1)
|
||||
)
|
||||
else:
|
||||
sn = str(sn)
|
||||
|
||||
return sn
|
||||
|
||||
@property
|
||||
def full_name(self):
|
||||
""" Format a 'full name' for this Part.
|
||||
|
Reference in New Issue
Block a user