Skip to content

Commit

Permalink
feat: add hook to allow downstream apps to add auto-loading instrumen…
Browse files Browse the repository at this point in the history
…tation for their doctypes (frappe#28479)
blaggacao authored Nov 15, 2024
1 parent d6eaf15 commit 67f2b05
Showing 2 changed files with 6 additions and 1 deletion.
4 changes: 3 additions & 1 deletion frappe/model/sync.py
Original file line number Diff line number Diff line change
@@ -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):
3 changes: 3 additions & 0 deletions frappe/utils/boilerplate.py
Original file line number Diff line number Diff line change
@@ -458,6 +458,9 @@ def _create_parent_folder_if_not_exists(self):
# 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
# ----------

0 comments on commit 67f2b05

Please sign in to comment.