From 59fe10bfbdf7fc2df7386c1405fb2eb91cba08ad Mon Sep 17 00:00:00 2001 From: Ankush Menat Date: Wed, 24 Jun 2026 19:18:28 +0530 Subject: [PATCH] perf: make CLI faster (#56437) --- erpnext/__init__.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/erpnext/__init__.py b/erpnext/__init__.py index 7e72b2b585d..1fb45004e6f 100644 --- a/erpnext/__init__.py +++ b/erpnext/__init__.py @@ -3,8 +3,6 @@ import inspect from typing import TypeVar import frappe -from frappe.model.document import Document -from frappe.utils.user import is_website_user __version__ = "17.0.0-dev" @@ -155,6 +153,8 @@ def allow_regional(fn): def check_app_permission(): + from frappe.utils.user import is_website_user + if frappe.session.user == "Administrator": return True @@ -175,6 +175,8 @@ def normalize_ctx_input(T: type) -> callable: - Casting the result to the specified type T """ + from frappe.model.document import Document + def decorator(func: callable): # conserve annotations for frappe.utils.typing_validations @functools.wraps(func, assigned=(a for a in functools.WRAPPER_ASSIGNMENTS if a != "__annotations__"))