diff --git a/erpnext/__init__.py b/erpnext/__init__.py index c4b79429a4b..8234c06fe40 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())