Fix for saving stock item objects

This commit is contained in:
Oliver 2021-11-10 11:22:58 +11:00
parent 067f12d5eb
commit ba11a73f91

View File

@ -235,8 +235,12 @@ class StockItem(MPTTModel):
# Default value if we cannot convert to an integer # Default value if we cannot convert to an integer
serial_int = 0 serial_int = 0
if serial is not None:
serial = str(serial)
# Look at the start of the string - can it be "integerized"? # Look at the start of the string - can it be "integerized"?
result = re.match(r'^(\d+)', serial or "") result = re.match(r'^(\d+)', serial)
if result and len(result.groups()) == 1: if result and len(result.groups()) == 1:
try: try: