diff --git a/InvenTree/stock/models.py b/InvenTree/stock/models.py index 12131b5b58..fa343e9a9c 100644 --- a/InvenTree/stock/models.py +++ b/InvenTree/stock/models.py @@ -454,11 +454,11 @@ class StockItem(MPTTModel): super().clean() # Strip serial number field - if self.serial: + if type(self.serial) is str: self.serial = self.serial.strip() # Strip batch code field - if self.batch: + if type(self.batch) is str: self.batch = self.batch.strip() try: