fix: Use older logic to set module_name and custom vars
(cherry picked from commit 87ed7796de)
This commit is contained in:
parent
b343db84a0
commit
34372e278e
1 changed files with 3 additions and 9 deletions
|
|
@ -34,15 +34,9 @@ def get_controller(doctype):
|
|||
from frappe.model.document import Document
|
||||
from frappe.utils.nestedset import NestedSet
|
||||
|
||||
if frappe.flags.in_migrate or frappe.flags.in_install or frappe.flags.in_patch:
|
||||
module_name, custom = ["Core", False]
|
||||
else:
|
||||
# this could be simplified in PY3.8 using walrus operators
|
||||
result = frappe.db.get_value("DocType", doctype, ("module", "custom"), cache=True)
|
||||
if result:
|
||||
module_name, custom = result
|
||||
else:
|
||||
module_name, custom = ["Core", bool(not frappe.db.exists(doctype))]
|
||||
module_name, custom = frappe.db.get_value(
|
||||
"DocType", doctype, ("module", "custom"), cache=True
|
||||
) or ["Core", False]
|
||||
|
||||
if custom:
|
||||
if frappe.db.field_exists("DocType", "is_tree"):
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue