diff --git a/erpnext/public/js/utils.js b/erpnext/public/js/utils.js index e481d722bd0493c3312b61bba3af1841ad8df2d2..0a3325de3810f18fe71fea6ba84365403a2e7c18 100755 --- a/erpnext/public/js/utils.js +++ b/erpnext/public/js/utils.js @@ -280,6 +280,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 36d3f6a58658b1056a62a17423445cc613154379..3177e41642fd52ec4ff20790cb219cb9763e6c63 100644 --- a/erpnext/stock/report/stock_balance/stock_balance.py +++ b/erpnext/stock/report/stock_balance/stock_balance.py @@ -420,16 +420,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( [