From 28913b97b04f9ce25a346acbf811aa4370122f07 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Fri, 31 Oct 2014 14:46:07 +0530 Subject: [PATCH 1/2] [fix] Null issue fixed in stock analytics report --- erpnext/public/js/stock_analytics.js | 1 + 1 file changed, 1 insertion(+) diff --git a/erpnext/public/js/stock_analytics.js b/erpnext/public/js/stock_analytics.js index a86d7ade95..091836f95e 100644 --- a/erpnext/public/js/stock_analytics.js +++ b/erpnext/public/js/stock_analytics.js @@ -131,6 +131,7 @@ erpnext.StockAnalytics = erpnext.StockGridReport.extend({ if(me.is_default("warehouse") ? true : me.warehouse == sl.warehouse) { var item = me.item_by_name[sl.item_code]; + if(item.closing_qty_value==undefined) item.closing_qty_value = 0; if(me.value_or_qty!="Quantity") { var wh = me.get_item_warehouse(sl.warehouse, sl.item_code); From 5288bdeabb59d016d4a4f78c8e76cf6764abbe88 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Mon, 3 Nov 2014 15:08:21 +0530 Subject: [PATCH 2/2] Minor fix --- erpnext/controllers/stock_controller.py | 4 ++-- erpnext/stock/stock_ledger.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/erpnext/controllers/stock_controller.py b/erpnext/controllers/stock_controller.py index 0f8eca4a7c..0a9adc0e05 100644 --- a/erpnext/controllers/stock_controller.py +++ b/erpnext/controllers/stock_controller.py @@ -175,7 +175,7 @@ class StockController(AccountsController): _(self.doctype), self.name, item.get("item_code"))) def get_sl_entries(self, d, args): - sl_dict = { + sl_dict = frappe._dict({ "item_code": d.get("item_code", None), "warehouse": d.get("warehouse", None), "posting_date": self.posting_date, @@ -192,7 +192,7 @@ class StockController(AccountsController): "serial_no": d.get("serial_no"), "project": d.get("project_name"), "is_cancelled": self.docstatus==2 and "Yes" or "No" - } + }) sl_dict.update(args) return sl_dict diff --git a/erpnext/stock/stock_ledger.py b/erpnext/stock/stock_ledger.py index edbdb1aa06..eae1bf68bf 100644 --- a/erpnext/stock/stock_ledger.py +++ b/erpnext/stock/stock_ledger.py @@ -27,7 +27,7 @@ def make_sl_entries(sl_entries, is_amended=None): if sle.get('is_cancelled') == 'Yes': sle['actual_qty'] = -flt(sle['actual_qty']) - if sle.get("actual_qty") or sle.voucher_type=="Stock Reconciliation": + if sle.get("actual_qty") or sle.get("voucher_type")=="Stock Reconciliation": sle_id = make_entry(sle) args = sle.copy()