Browse Source

fix: handle undefined tree filter value

version-14
prssanna 4 years ago
parent
commit
a429729e92
1 changed files with 4 additions and 1 deletions
  1. +4
    -1
      frappe/model/db_query.py

+ 4
- 1
frappe/model/db_query.py View File

@@ -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…
Cancel
Save