2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-07-05 21:20:56 +00:00

Changes to StockItem model

- Stock adjustments need to accept decimal values
This commit is contained in:
Oliver Walters
2019-11-19 09:18:41 +11:00
parent 20755a6dac
commit 75774771dc
2 changed files with 21 additions and 5 deletions

View File

@ -20,6 +20,8 @@ from InvenTree.views import QRCodeView
from InvenTree.helpers import str2bool, DownloadFile, GetExportFormats
from InvenTree.helpers import ExtractSerialNumbers
from decimal import Decimal
from datetime import datetime
from company.models import Company
@ -398,8 +400,9 @@ class StockAdjust(AjaxView, FormMixin):
valid = form.is_valid()
for item in self.stock_items:
try:
item.new_quantity = int(item.new_quantity)
item.new_quantity = Decimal(item.new_quantity)
except ValueError:
item.error = _('Must enter integer value')
valid = False