diff --git a/erpnext/public/js/utils.js b/erpnext/public/js/utils.js index c0126f2c6ee..39a341814db 100755 --- a/erpnext/public/js/utils.js +++ b/erpnext/public/js/utils.js @@ -263,6 +263,10 @@ $.extend(erpnext.utils, { fieldname: dimension["fieldname"], label: __(dimension["doctype"]), fieldtype: "MultiSelectList", + depends_on: + report_name === "Stock Balance" + ? "eval:doc.show_dimension_wise_stock === 1" + : "", get_data: function (txt) { return frappe.db.get_link_options(dimension["doctype"], txt); }, diff --git a/erpnext/stock/report/stock_balance/stock_balance.py b/erpnext/stock/report/stock_balance/stock_balance.py index 2153b1d73b3..b6587cd7b37 100644 --- a/erpnext/stock/report/stock_balance/stock_balance.py +++ b/erpnext/stock/report/stock_balance/stock_balance.py @@ -406,16 +406,17 @@ class StockBalanceReport: }, ] - for dimension in get_inventory_dimensions(): - columns.append( - { - "label": _(dimension.doctype), - "fieldname": dimension.fieldname, - "fieldtype": "Link", - "options": dimension.doctype, - "width": 110, - } - ) + if self.filters.get("show_dimension_wise_stock"): + for dimension in get_inventory_dimensions(): + columns.append( + { + "label": _(dimension.doctype), + "fieldname": dimension.fieldname, + "fieldtype": "Link", + "options": dimension.doctype, + "width": 110, + } + ) columns.extend( [