fix: match db_query behaviour for certain cases like

`filters.append(["reports_to", "=", ""])`

Earlier this generated:
```
( `tabEmployee`.`reports_to` is NULL OR `tabEmployee`.`reports_to` = '' )
```

Without this change, with qb it was

```
`reports_to`=''
```

Signed-off-by: Akhil Narang <me@akhilnarang.dev>
This commit is contained in:
Akhil Narang 2025-11-18 18:18:53 +05:30
parent 952b0d4500
commit bd84d7a66a
No known key found for this signature in database
GPG key ID: 9DCC61E211BF645F

View file

@ -1420,7 +1420,12 @@ class Engine:
if value is None:
return False
if operator.lower() in ("=", "like", "is"):
if operator.lower() in ("like", "is"):
return False
# For "=" operator, only skip IFNULL if value is truthy (non-empty string, non-zero, etc)
# When value is empty string "", we need to check for NULL values too
if operator.lower() == "=" and value:
return False
try: