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:
parent
952b0d4500
commit
bd84d7a66a
1 changed files with 6 additions and 1 deletions
|
|
@ -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:
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue