Show Stock Level section only to stock maintain items (#11073)

This commit is contained in:
Stavros Anastasiadis 2017-10-05 16:11:51 +03:00 committed by Nabin Hait
parent bf3b54f658
commit e31757b001

View File

@ -249,15 +249,18 @@ $.extend(erpnext.item, {
if(frm.doc.__islocal)
return;
frappe.require('assets/js/item-dashboard.min.js', function() {
var section = frm.dashboard.add_section('<h5 style="margin-top: 0px;">\
<a href="#stock-balance">' + __("Stock Levels") + '</a></h5>');
erpnext.item.item_dashboard = new erpnext.stock.ItemDashboard({
parent: section,
item_code: frm.doc.name
// Show Stock Levels only if is_stock_item
if (frm.doc.is_stock_item) {
frappe.require('assets/js/item-dashboard.min.js', function() {
var section = frm.dashboard.add_section('<h5 style="margin-top: 0px;">\
<a href="#stock-balance">' + __("Stock Levels") + '</a></h5>');
erpnext.item.item_dashboard = new erpnext.stock.ItemDashboard({
parent: section,
item_code: frm.doc.name
});
erpnext.item.item_dashboard.refresh();
});
erpnext.item.item_dashboard.refresh();
});
}
},
edit_prices_button: function(frm) {