Merge pull request #889 from SchrodingersGat/allow-empty-stock

Allow creation of a stock item with zero quantity
This commit is contained in:
Oliver 2020-07-30 21:09:57 +10:00 committed by GitHub
commit e0e82dabf3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1239,8 +1239,8 @@ class StockItemCreate(AjaxCreateView):
valid = False
form.errors['quantity'] = [_('Invalid quantity')]
if quantity <= 0:
form.errors['quantity'] = [_('Quantity must be greater than zero')]
if quantity < 0:
form.errors['quantity'] = [_('Quantity cannot be less than zero')]
valid = False
if part is None: