diff --git a/erpnext/__init__.py b/erpnext/__init__.py index 910a6c95ebd..6f653026dde 100644 --- a/erpnext/__init__.py +++ b/erpnext/__init__.py @@ -177,7 +177,12 @@ def normalize_ctx_input(T: type) -> callable: 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__")) + @functools.wraps( + func, + assigned=( + a for a in functools.WRAPPER_ASSIGNMENTS if a not in ("__annotations__", "__annotate__") + ), + ) def wrapper(ctx: T | Document | dict | str, *args, **kwargs): if isinstance(ctx, Document): ctx = T(**ctx.as_dict())