瀏覽代碼

fix: handle undefined tree filter value

version-14
prssanna 4 年之前
父節點
當前提交
a429729e92
共有 1 個檔案被更改,包括 4 行新增1 行删除
  1. +4
    -1
      frappe/model/db_query.py

+ 4
- 1
frappe/model/db_query.py 查看文件

@@ -391,7 +391,10 @@ class DatabaseQuery(object):
ref_doctype = frappe.get_meta(f.doctype).get_field(f.fieldname).options

result=[]
lft, rgt = frappe.db.get_value(ref_doctype, f.value, ["lft", "rgt"])

lft, rgt = '', ''
if f.value:
lft, rgt = frappe.db.get_value(ref_doctype, f.value, ["lft", "rgt"])

# Get descendants elements of a DocType with a tree structure
if f.operator.lower() in ('descendants of', 'not descendants of') :


Loading…
取消
儲存