From 45f5f71dbaf9faaff6d209a684cc236c2dbff38a Mon Sep 17 00:00:00 2001 From: sibikumarkuppusamy Date: Tue, 19 Nov 2024 19:29:58 +0530 Subject: [PATCH] fix: fetch from sql --- frappe/core/doctype/doctype/doctype.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frappe/core/doctype/doctype/doctype.py b/frappe/core/doctype/doctype/doctype.py index 61da5dfff9f1..9bee329a8f56 100644 --- a/frappe/core/doctype/doctype/doctype.py +++ b/frappe/core/doctype/doctype/doctype.py @@ -367,7 +367,7 @@ def setup_fields_to_fetch(self): SET `{fieldname}` = source.`{source_fieldname}` FROM `tab{link_doctype}` AS source WHERE `target`.`{link_fieldname}` = `source`.`name` - AND ifnull(`target`.`{fieldname}`, '')='' + AND (`target`.`{fieldname}` IS NULL OR `target`.`{fieldname}` = 0) """ else: update_query = """