From 2128c98c353285f9d76c2d276af018397a06d41f Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Thu, 12 Jun 2014 12:42:22 +0530 Subject: [PATCH] available qty validation. Fixes #1045 --- erpnext/stock/doctype/stock_entry/stock_entry.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/erpnext/stock/doctype/stock_entry/stock_entry.py b/erpnext/stock/doctype/stock_entry/stock_entry.py index da176b0976..bbe461e79a 100644 --- a/erpnext/stock/doctype/stock_entry/stock_entry.py +++ b/erpnext/stock/doctype/stock_entry/stock_entry.py @@ -202,6 +202,10 @@ class StockEntry(StockController): }) # get actual stock at source warehouse d.actual_qty = get_previous_sle(args).get("qty_after_transaction") or 0 + if d.s_warehouse and d.actual_qty <= d.transfer_qty: + frappe.throw(_("""Row {0}: Qty not avalable in warehouse {1} on {2} {3}. + Available Qty: {4}, Transfer Qty: {5}""").format(d.idx, d.s_warehouse, + self.posting_date, self.posting_time, d.actual_qty, d.transfer_qty)) # get incoming rate if not d.bom_no: