Merge pull request #21676 from rohitwaghchaure/fixed-qty-validation-in-stock-entry

fix: '<' not supported between instances of 'str' and 'int'
This commit is contained in:
Deepesh Garg 2020-05-11 12:27:20 +05:30 committed by GitHub
commit ece1b4bc5a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -181,7 +181,7 @@ class StockEntry(StockController):
stock_items = self.get_stock_items()
serialized_items = self.get_serialized_items()
for item in self.get("items"):
if item.qty and item.qty < 0:
if flt(item.qty) and flt(item.qty) < 0:
frappe.throw(_("Row {0}: The item {1}, quantity must be positive number")
.format(item.idx, frappe.bold(item.item_code)))