From c9f0528dfc255425b2a15257d4236259c5878d1f Mon Sep 17 00:00:00 2001 From: Matthias Date: Wed, 29 Dec 2021 02:24:00 +0100 Subject: [PATCH] append api call --- InvenTree/InvenTree/helpers.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/InvenTree/InvenTree/helpers.py b/InvenTree/InvenTree/helpers.py index fd86306627..a97b32a9ba 100644 --- a/InvenTree/InvenTree/helpers.py +++ b/InvenTree/InvenTree/helpers.py @@ -404,17 +404,19 @@ def DownloadFile(data, filename, content_type='application/text', inline=False): return response -def extract_serial_numbers(serials, expected_quantity): +def extract_serial_numbers(serials, expected_quantity, next_number: int): """ Attempt to extract serial numbers from an input string. - Serial numbers must be integer values - Serial numbers must be positive - Serial numbers can be split by whitespace / newline / commma chars - Serial numbers can be supplied as an inclusive range using hyphen char e.g. 10-20 + - Serial numbers can be defined as ~ for getting the next available serial number - Serial numbers can be supplied as + for getting all expecteded numbers starting from - Serial numbers can be supplied as + for getting numbers starting from Args: expected_quantity: The number of (unique) serial numbers we expect + next_number(int): the next possible serial number """ serials = serials.strip()