fix: skip overriden doctypes during orphan check (#23518)

These are prone to breakage and shouldn't be deleted automatically.

This mostly works fine but there can be cases where it doesn't. So best to leave them untouched.
This commit is contained in:
Ankush Menat 2023-11-30 17:03:42 +05:30 committed by GitHub
parent 286e0a7b96
commit ebbd3cd137
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -153,8 +153,11 @@ def remove_orphan_doctypes():
orphan_doctypes = []
clear_controller_cache()
class_overrides = frappe.get_hooks("override_doctype_class", {})
for doctype in doctype_names:
if doctype in class_overrides:
continue
try:
get_controller(doctype=doctype)
except ImportError: