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

@@ -77,7 +77,7 @@ def get_issued_items_cost():
"""select se.project, sum(se_item.amount) as amount
from `tabStock Entry` se, `tabStock Entry Detail` se_item
where se.name = se_item.parent and se.docstatus = 1 and ifnull(se_item.t_warehouse, '') = ''
and ifnull(se.project, '') != '' group by se.project""",
and se.project != '' group by se.project""",
as_dict=1,
)