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,6 +249,8 @@ $.extend(erpnext.item, {
if(frm.doc.__islocal) if(frm.doc.__islocal)
return; return;
// Show Stock Levels only if is_stock_item
if (frm.doc.is_stock_item) {
frappe.require('assets/js/item-dashboard.min.js', function() { frappe.require('assets/js/item-dashboard.min.js', function() {
var section = frm.dashboard.add_section('<h5 style="margin-top: 0px;">\ var section = frm.dashboard.add_section('<h5 style="margin-top: 0px;">\
<a href="#stock-balance">' + __("Stock Levels") + '</a></h5>'); <a href="#stock-balance">' + __("Stock Levels") + '</a></h5>');
@ -258,6 +260,7 @@ $.extend(erpnext.item, {
}); });
erpnext.item.item_dashboard.refresh(); erpnext.item.item_dashboard.refresh();
}); });
}
}, },
edit_prices_button: function(frm) { edit_prices_button: function(frm) {