From a39753ee0834d37f4b7a4936dfa62b3e38d881ef Mon Sep 17 00:00:00 2001 From: pandiyan Date: Fri, 3 Jul 2026 18:25:01 +0530 Subject: [PATCH 1/2] fix: clear stray permission message when item dashboard has no warehouse access (cherry picked from commit 8c7b2f4d3cd374d1e51e083e850c7a71de0fbd06) --- erpnext/stock/dashboard/item_dashboard.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/erpnext/stock/dashboard/item_dashboard.py b/erpnext/stock/dashboard/item_dashboard.py index 5de54c55461..9d1c7b55122 100644 --- a/erpnext/stock/dashboard/item_dashboard.py +++ b/erpnext/stock/dashboard/item_dashboard.py @@ -12,6 +12,9 @@ def get_data( item_code=None, warehouse=None, item_group=None, start=0, sort_by="actual_qty", sort_order="desc" ): """Return data to render the item dashboard""" + if not frappe.has_permission("Bin", "read"): + return [] + filters = [] if item_code: filters.append(["item_code", "=", item_code]) @@ -33,7 +36,10 @@ def get_data( if build_match_conditions("Warehouse", user=frappe.session.user): filters.append(["warehouse", "in", [w.name for w in frappe.get_list("Warehouse")]]) except frappe.PermissionError: - # user does not have access on warehouse + # user does not have access on warehouse; build_match_conditions already queued a + # "Not permitted" message via frappe.throw before this was caught, drop it so the + # client doesn't show a spurious error for a request that's failing gracefully here + frappe.clear_last_message() return [] items = frappe.db.get_all( From c9648112935ac15fe10aa3f80cf80480b56b1d1e Mon Sep 17 00:00:00 2001 From: pandiyan Date: Fri, 3 Jul 2026 18:25:08 +0530 Subject: [PATCH 2/2] fix: skip item prices tab render for users without item price read access (cherry picked from commit ef794f390cde3d5666aa8aa5f13d9f9049246553) --- erpnext/stock/doctype/item/item.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/erpnext/stock/doctype/item/item.js b/erpnext/stock/doctype/item/item.js index 8bb5bc373e7..c37e35d2114 100644 --- a/erpnext/stock/doctype/item/item.js +++ b/erpnext/stock/doctype/item/item.js @@ -668,6 +668,13 @@ $.extend(erpnext.item, { render_item_prices: function (frm) { if (frm.doc.__islocal) return; + + if (!frappe.model.can_read("Item Price")) { + frm.toggle_display("prices_html", false); + return; + } + frm.toggle_display("prices_html", true); + const requested_item = frm.doc.name; const container = frm.fields_dict["prices_html"].$wrapper;