Просмотр исходного кода

fix: Check for db value if cache doesn't exist

in get_controller, if cached value doesn't exist for a DocType in the
frappe.db.value_cache, then query the db as fallback before the final
fallback of assuming module as Core and non custom

(cherry picked from commit 05712abc60)
version-14
Gavin D'souza 4 лет назад
committed by mergify-bot
Родитель
Сommit
8d8a6cbd5d
1 измененных файлов: 4 добавлений и 1 удалений
  1. +4
    -1
      frappe/model/base_document.py

+ 4
- 1
frappe/model/base_document.py Просмотреть файл

@@ -34,8 +34,11 @@ def get_controller(doctype):
from frappe.model.document import Document
from frappe.utils.nestedset import NestedSet

module_name, custom = frappe.db.get_value("DocType", doctype, ("module", "custom"), cache=True) \
module_name, custom = (
frappe.db.get_value("DocType", doctype, ("module", "custom"), cache=True)
or frappe.db.get_value("DocType", doctype, ("module", "custom"))
or ["Core", False]
)

if custom:
if frappe.db.field_exists("DocType", "is_tree"):


Загрузка…
Отмена
Сохранить