fix: permission issue (#57112)

(cherry picked from commit 1fd2faa68d)

# Conflicts:
#	erpnext/controllers/stock_controller.py
This commit is contained in:
rohitwaghchaure
2026-07-14 17:52:48 +05:30
committed by Mergify
parent 82f2af3a0e
commit 95b2b075ba

View File

@@ -1515,7 +1515,12 @@ class StockController(AccountsController):
@frappe.whitelist()
def show_accounting_ledger_preview(company, doctype, docname):
filters = frappe._dict(company=company, include_dimensions=1)
<<<<<<< HEAD
doc = frappe.get_doc(doctype, docname)
=======
doc = frappe.get_lazy_doc(doctype, docname)
doc.check_permission("read")
>>>>>>> 1fd2faa68d (fix: permission issue (#57112))
doc.run_method("before_gl_preview")
gl_columns, gl_data = get_accounting_ledger_preview(doc, filters)
@@ -1528,7 +1533,12 @@ def show_accounting_ledger_preview(company, doctype, docname):
@frappe.whitelist()
def show_stock_ledger_preview(company, doctype, docname):
filters = frappe._dict(company=company)
<<<<<<< HEAD
doc = frappe.get_doc(doctype, docname)
=======
doc = frappe.get_lazy_doc(doctype, docname)
doc.check_permission("read")
>>>>>>> 1fd2faa68d (fix: permission issue (#57112))
doc.run_method("before_sl_preview")
sl_columns, sl_data = get_stock_ledger_preview(doc, filters)