Fixed exception for quantity check

This commit is contained in:
eeintech 2021-04-28 16:46:42 -04:00
parent a63d5012f0
commit d072187bf8

View File

@ -342,7 +342,7 @@ class PurchaseOrder(Order):
if quantity < 0:
raise ValidationError({"quantity": _("Quantity must be a positive number")})
quantity = int(quantity)
except ValueError:
except (ValueError, TypeError):
raise ValidationError({"quantity": _("Invalid quantity provided")})
# Create a new stock item