fix: stock levels disapperaing on refresh (bp #26305)

refresh_section removes all sections with `custom` class, added
different class to avoid this behaviour.

# Conflicts:
#	erpnext/stock/doctype/item/item.js
This commit is contained in:
Ankush
2021-07-12 10:20:19 +05:30
committed by GitHub
parent f7748e4109
commit caacd0ad2c

View File

@@ -381,7 +381,8 @@ $.extend(erpnext.item, {
// Show Stock Levels only if is_stock_item // Show Stock Levels only if is_stock_item
if (frm.doc.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() {
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({ erpnext.item.item_dashboard = new erpnext.stock.ItemDashboard({
parent: section, parent: section,
item_code: frm.doc.name, item_code: frm.doc.name,