perf: don't use ifnull where it's not required (#36336)

ifnull isn't really required when doing `!= 'anything'` because if it's null then value will be falsy.
ifnull is only required when checking `= ''` if you treat `null = ''`

Actuall better fix would be make things explcitly non-nullable, then we won't ever have to add this on such fields.

ref: https://github.com/frappe/frappe/pull/21822
This commit is contained in:
Ankush Menat
2023-07-27 11:36:07 +05:30
committed by GitHub
parent 56e7cc7e05
commit 1d7dbd3456
7 changed files with 8 additions and 8 deletions

View File

@@ -161,7 +161,7 @@ def get_leaf_boms() -> List[str]:
"""select name from `tabBOM` bom
where docstatus=1 and is_active=1
and not exists(select bom_no from `tabBOM Item`
where parent=bom.name and ifnull(bom_no, '')!='')"""
where parent=bom.name and bom_no !='')"""
)