Merge pull request #21005 from rohitwaghchaure/qty_must_be_positive_for_stock_entry_develop

fix: stock entry qty must be positive
This commit is contained in:
Deepesh Garg
2020-03-21 20:46:10 +05:30
committed by GitHub

View File

@@ -177,6 +177,10 @@ 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:
frappe.throw(_("Row {0}: The item {1}, quantity must be positive number")
.format(item.idx, frappe.bold(item.item_code)))
if item.item_code not in stock_items:
frappe.throw(_("{0} is not a stock Item").format(item.item_code))