Skip to content

Commit

Permalink
fix: stock levels disapperaing on refresh
Browse files Browse the repository at this point in the history
refresh_section removes all sections with `custom` class, added
different class to avoid this behaviour.
  • Loading branch information
ankush committed Jul 12, 2021
1 parent e39a7f2 commit b99469c
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions erpnext/stock/doctype/item/item.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down Expand Up @@ -381,7 +381,8 @@ $.extend(erpnext.item, {
// 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,
Expand Down

0 comments on commit b99469c

Please sign in to comment.