2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-07-06 05:30:56 +00:00

Add unit tests for serial number functionality

This commit is contained in:
Oliver
2022-03-07 14:07:01 +11:00
parent 2f3f57148a
commit 0adf89e793
4 changed files with 80 additions and 5 deletions

View File

@ -269,11 +269,14 @@ class StockItem(MPTTModel):
serial_int = 0
if serial is not None:
serial = str(serial).strip()
serial_int = extract_int(str(serial))
self.serial_int = serial_int
def get_next_serial_number(self, include_variants=True, reverse=False):
def get_next_serialized_item(self, include_variants=True, reverse=False):
"""
Get the "next" serial number for the part this stock item references.