fix: Use Document in case get_controller raises import errors
(cherry picked from commit a3b79081d6)
This commit is contained in:
parent
1e55ab34c3
commit
804e4e212d
1 changed files with 5 additions and 1 deletions
|
|
@ -109,7 +109,11 @@ class DocType(Document):
|
|||
|
||||
from frappe.model.base_document import get_controller
|
||||
|
||||
controller = get_controller(self.name)
|
||||
try:
|
||||
controller = get_controller(self.name)
|
||||
except ImportError:
|
||||
controller = Document
|
||||
|
||||
available_objects = {x for x in dir(controller) if isinstance(x, str)}
|
||||
property_set = {
|
||||
x for x in available_objects if isinstance(getattr(controller, x, None), property)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue