diff --git a/erpnext/setup/doctype/email_digest/email_digest.py b/erpnext/setup/doctype/email_digest/email_digest.py index ae3d800e3f..40472a27cb 100644 --- a/erpnext/setup/doctype/email_digest/email_digest.py +++ b/erpnext/setup/doctype/email_digest/email_digest.py @@ -142,7 +142,7 @@ class DocType: r['value'] = float(r['debit'] - r['credit']) #webnotes.msgprint(query) #webnotes.msgprint(res) - result[query] = (res and len(res)==1) and res[0] or (res and res or None) + result[query] = res and (len(res)==1 and res[0]) or (res or None) if result[query] is None: del result[query]