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
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -93,7 +93,7 @@ frappe.ui.form.on("Item", {
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 @@ $.extend(erpnext.item, {
// Show Stock Levels only if is_stock_item
if (frm.doc.is_stock_item) {
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({
parent: section,
item_code: frm.doc.name,