From a315a319199412d5d19f7b49171195ba209599ce Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Mon, 17 Oct 2011 15:01:31 +0530 Subject: [PATCH] Issue fixed in get stock qty if bin not exists --- erpnext/stock/doctype/stock_entry/stock_entry.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/stock/doctype/stock_entry/stock_entry.py b/erpnext/stock/doctype/stock_entry/stock_entry.py index b799eaa463..2c36d0f1b3 100644 --- a/erpnext/stock/doctype/stock_entry/stock_entry.py +++ b/erpnext/stock/doctype/stock_entry/stock_entry.py @@ -93,7 +93,7 @@ class DocType: def get_as_on_stock(self, item, wh, dt, tm): bin = sql("select name from tabBin where item_code = %s and warehouse = %s", (item, wh)) bin_id = bin and bin[0][0] or '' - prev_sle = get_obj('Bin', bin_id).get_prev_sle(dt, tm) + prev_sle = bin_id and get_obj('Bin', bin_id).get_prev_sle(dt, tm) or {} qty = flt(prev_sle.get('bin_aqat', 0)) return qty