From c6802ca6d02abfbdc534b20c5cada47c1cc8d264 Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Thu, 27 Aug 2015 13:21:43 +0530 Subject: [PATCH] [minor] show Inventory section for new Item if Maintain Stock is checked --- erpnext/stock/doctype/item/item.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/erpnext/stock/doctype/item/item.js b/erpnext/stock/doctype/item/item.js index e32080a477..7aa5a03897 100644 --- a/erpnext/stock/doctype/item/item.js +++ b/erpnext/stock/doctype/item/item.js @@ -59,6 +59,10 @@ frappe.ui.form.on("Item", { erpnext.item.toggle_reqd(frm); erpnext.item.toggle_attributes(frm); + + if (frm.is_new() && frm.doc.is_stock_item) { + frm.fields_dict.inventory.collapse(false); + } }, validate: function(frm){ @@ -91,6 +95,7 @@ frappe.ui.form.on("Item", { }, is_stock_item: function(frm) { + frm.is_new() && frm.fields_dict.inventory.collapse(!frm.doc.is_stock_item); erpnext.item.toggle_reqd(frm); },