perf: Use lazy loaded documents (#48017)

* perf: Use lazy docs for status updaters and similar use cases

* perf: lazy load documents while reposting
This commit is contained in:
Ankush Menat
2025-06-11 15:57:08 +05:30
committed by GitHub
parent 76982fe133
commit d16a6d42a5
17 changed files with 44 additions and 47 deletions

View File

@@ -1444,7 +1444,7 @@ class StockController(AccountsController):
@frappe.whitelist()
def show_accounting_ledger_preview(company, doctype, docname):
filters = frappe._dict(company=company, include_dimensions=1)
doc = frappe.get_doc(doctype, docname)
doc = frappe.get_lazy_doc(doctype, docname)
doc.run_method("before_gl_preview")
gl_columns, gl_data = get_accounting_ledger_preview(doc, filters)
@@ -1457,7 +1457,7 @@ def show_accounting_ledger_preview(company, doctype, docname):
@frappe.whitelist()
def show_stock_ledger_preview(company, doctype, docname):
filters = frappe._dict(company=company)
doc = frappe.get_doc(doctype, docname)
doc = frappe.get_lazy_doc(doctype, docname)
doc.run_method("before_sl_preview")
sl_columns, sl_data = get_stock_ledger_preview(doc, filters)