fix: Module not found error for custom doctypes

This commit is contained in:
Ejaaz Khan 2025-04-25 14:51:16 +05:30
parent 965728cd9b
commit 2e0db2d69e

View file

@ -564,7 +564,16 @@ def _get_linked_doctypes(doctype, without_ignore_user_permissions_enabled=False)
continue
ret[dt] = {"get_parent": True}
custom_doctypes = frappe.get_all(
doctype="DocType", filters=[["custom", "=", 1], ["name", "in", list(ret.keys())]], as_list=True
)
custom_doctypes = [item[0] for item in custom_doctypes]
for dt in list(ret):
# if the custom checkbox is checked, then don't load the module of the DocType because it doesn't belong to any app.
if dt in custom_doctypes:
continue
try:
doctype_module = load_doctype_module(dt)
except (ImportError, KeyError):