fix: Module not found error for custom doctypes
This commit is contained in:
parent
965728cd9b
commit
2e0db2d69e
1 changed files with 9 additions and 0 deletions
|
|
@ -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):
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue