From 6b23b007a4e03de7f98609ed33c15f9a09bf244c Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Wed, 15 Jul 2026 14:34:44 +0530 Subject: [PATCH] fix: permission issue (backport #57112) (#57142) * fix: permission issue (#57112) (cherry picked from commit 1fd2faa68d0b4960d9e2e48ab782be9cc6b1b644) # Conflicts: # erpnext/controllers/stock_controller.py * chore: fix conflicts --------- Co-authored-by: rohitwaghchaure --- erpnext/controllers/stock_controller.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/erpnext/controllers/stock_controller.py b/erpnext/controllers/stock_controller.py index c48eb2bd620..b4218b85f0e 100644 --- a/erpnext/controllers/stock_controller.py +++ b/erpnext/controllers/stock_controller.py @@ -1513,9 +1513,10 @@ class StockController(AccountsController): @frappe.whitelist() -def show_accounting_ledger_preview(company, doctype, docname): +def show_accounting_ledger_preview(company: str, doctype: str, docname: str): filters = frappe._dict(company=company, include_dimensions=1) doc = frappe.get_doc(doctype, docname) + doc.check_permission("read") doc.run_method("before_gl_preview") gl_columns, gl_data = get_accounting_ledger_preview(doc, filters) @@ -1526,9 +1527,10 @@ def show_accounting_ledger_preview(company, doctype, docname): @frappe.whitelist() -def show_stock_ledger_preview(company, doctype, docname): +def show_stock_ledger_preview(company: str, doctype: str, docname: str): filters = frappe._dict(company=company) doc = frappe.get_doc(doctype, docname) + doc.check_permission("read") doc.run_method("before_sl_preview") sl_columns, sl_data = get_stock_ledger_preview(doc, filters)