From 61a7b42aea63f49ff3a1b7e49d7b2edc37e482a5 Mon Sep 17 00:00:00 2001 From: Anurag Mishra Date: Thu, 23 May 2019 14:31:22 +0530 Subject: [PATCH] fix: added permission and fix filters in stock balance report --- .../warehouse_type/warehouse_type.json | 59 ++++++++++++++++++- .../report/stock_balance/stock_balance.js | 8 ++- 2 files changed, 63 insertions(+), 4 deletions(-) diff --git a/erpnext/stock/doctype/warehouse_type/warehouse_type.json b/erpnext/stock/doctype/warehouse_type/warehouse_type.json index 905bb4f136..905942e33e 100644 --- a/erpnext/stock/doctype/warehouse_type/warehouse_type.json +++ b/erpnext/stock/doctype/warehouse_type/warehouse_type.json @@ -13,7 +13,7 @@ "label": "Description" } ], - "modified": "2019-05-21 15:30:06.754938", + "modified": "2019-05-23 14:30:11.435978", "modified_by": "Administrator", "module": "Stock", "name": "Warehouse Type", @@ -30,6 +30,63 @@ "role": "System Manager", "share": 1, "write": 1 + }, + { + "create": 1, + "delete": 1, + "email": 1, + "export": 1, + "print": 1, + "read": 1, + "report": 1, + "role": "Item Manager", + "share": 1, + "write": 1 + }, + { + "email": 1, + "export": 1, + "print": 1, + "read": 1, + "report": 1, + "role": "Sales User", + "share": 1 + }, + { + "email": 1, + "export": 1, + "print": 1, + "read": 1, + "report": 1, + "role": "Stock User", + "share": 1 + }, + { + "email": 1, + "export": 1, + "print": 1, + "read": 1, + "report": 1, + "role": "Purchase User", + "share": 1 + }, + { + "email": 1, + "export": 1, + "print": 1, + "read": 1, + "report": 1, + "role": "Accounts User", + "share": 1 + }, + { + "email": 1, + "export": 1, + "print": 1, + "read": 1, + "report": 1, + "role": "Manufacturing User", + "share": 1 } ], "quick_entry": 1, diff --git a/erpnext/stock/report/stock_balance/stock_balance.js b/erpnext/stock/report/stock_balance/stock_balance.js index 93ce897b8d..07e5f4b3d7 100644 --- a/erpnext/stock/report/stock_balance/stock_balance.js +++ b/erpnext/stock/report/stock_balance/stock_balance.js @@ -52,9 +52,11 @@ frappe.query_reports["Stock Balance"] = { "options": "Warehouse", get_query: () => { var warehouse_type = frappe.query_report.get_filter_value('warehouse_type'); - return { - filters: { - 'warehouse_type': warehouse_type + if(warehouse_type){ + return { + filters: { + 'warehouse_type': warehouse_type + } } } }