feat: add hook to allow downstream apps to add auto-loading instrumentation for their doctypes (#28479)

This commit is contained in:
David Arnold 2024-11-15 14:04:20 +01:00 committed by GitHub
parent d6eaf15d84
commit 67f2b056b4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 6 additions and 1 deletions

View file

@ -126,7 +126,9 @@ def get_doc_files(files, start_path):
files = files or []
for _module, doctype in IMPORTABLE_DOCTYPES:
for _module, doctype in IMPORTABLE_DOCTYPES + [
(None, frappe.scrub(dt)) for dt in frappe.get_hooks("importable_doctypes")
]:
doctype_path = os.path.join(start_path, doctype)
if os.path.exists(doctype_path):
for docname in os.listdir(doctype_path):

View file

@ -458,6 +458,9 @@ app_license = "{app_license}"
# automatically create page for each record of this doctype
# website_generators = ["Web Page"]
# automatically load and sync documents of this doctype from downstream apps
# importable_doctypes = [doctype_1]
# Jinja
# ----------