Merge pull request #22056 from marination/qty-validation-in-stock-entry-hotfix

fix: '<' not supported between instances of 'str' and 'int'
This commit is contained in:
Deepesh Garg
2020-05-30 19:49:57 +05:30
committed by GitHub

View File

@@ -178,7 +178,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)))