From 8c6b0b48ed50549b584f9cbb23a0abdbdfd84e98 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Tue, 26 Jul 2011 17:21:36 +0530 Subject: [PATCH] fixed issue in stock reco if no prev sle exists --- stock/doctype/stock_reconciliation/stock_reconciliation.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stock/doctype/stock_reconciliation/stock_reconciliation.py b/stock/doctype/stock_reconciliation/stock_reconciliation.py index 69710f0eab..f040df3839 100644 --- a/stock/doctype/stock_reconciliation/stock_reconciliation.py +++ b/stock/doctype/stock_reconciliation/stock_reconciliation.py @@ -118,7 +118,7 @@ class DocType: # ------------------ def get_current_stock(self, item_code, warehouse): bin = sql("select name from `tabBin` where item_code = '%s' and warehouse = '%s'" % (item_code, warehouse)) - prev_sle = bin and get_obj('Bin', bin[0][0]).get_prev_sle(self.doc.reconciliation_date,self.doc.reconciliation_time) or 0 + prev_sle = bin and get_obj('Bin', bin[0][0]).get_prev_sle(self.doc.reconciliation_date,self.doc.reconciliation_time) or {} stock_uom = sql("select stock_uom from `tabItem` where name = %s",item_code) return {'actual_qty': prev_sle.get('bin_aqat', 0), 'stock_uom': stock_uom[0][0]}