fix: stock levels disapperaing on refresh
refresh_section removes all sections with `custom` class, added
different class to avoid this behaviour.
diff --git a/erpnext/stock/doctype/item/item.js b/erpnext/stock/doctype/item/item.js
index 45e3c21..568f0ef 100644
--- a/erpnext/stock/doctype/item/item.js
+++ b/erpnext/stock/doctype/item/item.js
@@ -93,7 +93,7 @@
erpnext.item.edit_prices_button(frm);
erpnext.item.toggle_attributes(frm);
-
+
if (!frm.doc.is_fixed_asset) {
erpnext.item.make_dashboard(frm);
}
@@ -381,7 +381,8 @@
// Show Stock Levels only if is_stock_item
if (frm.doc.is_stock_item) {
frappe.require('item-dashboard.bundle.js', function() {
- const section = frm.dashboard.add_section('', __("Stock Levels"));
+ frm.dashboard.parent.find('.stock-levels').remove();
+ const section = frm.dashboard.add_section('', __("Stock Levels"), 'stock-levels');
erpnext.item.item_dashboard = new erpnext.stock.ItemDashboard({
parent: section,
item_code: frm.doc.name,