From 58b587834ec3997cd922ce21b838cc3e2281d82c Mon Sep 17 00:00:00 2001 From: Stavros Anastasiadis Date: Thu, 5 Oct 2017 16:14:50 +0300 Subject: [PATCH] Provide a minor warning message if no stock levels are availiable (#11074) * Provide a minor warning message if no stock levels are availiable * Update item_dashboard.js --- erpnext/stock/dashboard/item_dashboard.js | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/erpnext/stock/dashboard/item_dashboard.js b/erpnext/stock/dashboard/item_dashboard.js index e9499895fe..113a2efb50 100644 --- a/erpnext/stock/dashboard/item_dashboard.js +++ b/erpnext/stock/dashboard/item_dashboard.js @@ -75,8 +75,13 @@ erpnext.stock.ItemDashboard = Class.extend({ this.content.find('.more').addClass('hidden'); } - $(frappe.render_template('item_dashboard_list', context)).appendTo(this.result); - + // If not any stock in any warehouses provide a message to end user + if (context.data.length > 0) { + $(frappe.render_template('item_dashboard_list', context)).appendTo(this.result); + } else { + var message = __(" Currently no stock available in any warehouse") + $(" "+message+"").appendTo(this.result); + } }, get_item_dashboard_data: function(data, max_count, show_item) { if(!max_count) max_count = 0; @@ -182,4 +187,4 @@ erpnext.stock.move_item = function(item, source, target, actual_qty, rate, callb frappe.set_route('Form', doc.doctype, doc.name); }) }); -} \ No newline at end of file +}