diff --git a/erpnext/public/js/utils.js b/erpnext/public/js/utils.js index e714b9e89f7a2a83c1c37a979cab996068f0342d..14e0b7564766623ff4f1b422768933a885e00cb1 100755 --- a/erpnext/public/js/utils.js +++ b/erpnext/public/js/utils.js @@ -247,10 +247,14 @@ $.extend(erpnext.utils, { if (!found) { filters.splice(index, 0, { - "fieldname": dimension["fieldname"], - "label": __(dimension["doctype"]), - "fieldtype": "MultiSelectList", - get_data: function(txt) { + 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 1ab2ad10f53e093c8e97326f08d3f945f8eb4917..66979d8bf638f99648c5fa3833377b357fcd6659 100644 --- a/erpnext/stock/report/stock_balance/stock_balance.py +++ b/erpnext/stock/report/stock_balance/stock_balance.py @@ -393,16 +393,17 @@ class StockBalanceReport(object): }, ] - 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( [