From 1f16c1d615de0ddf9f668402ba637eb8c7d52854 Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Fri, 24 Jan 2014 21:48:06 +0530 Subject: [PATCH] Fix: ToDo Patch and Notifications query --- webnotes/core/notifications.py | 2 +- webnotes/patches/4_0/set_todo_checked_as_closed.py | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/webnotes/core/notifications.py b/webnotes/core/notifications.py index ec358efcf6..03164b5a44 100644 --- a/webnotes/core/notifications.py +++ b/webnotes/core/notifications.py @@ -22,7 +22,7 @@ def get_things_todo(): """Returns a count of incomplete todos""" incomplete_todos = webnotes.conn.sql("""\ SELECT COUNT(*) FROM `tabToDo` - WHERE IFNULL(checked, 0) = 0 + WHERE status="Open" AND (owner = %s or assigned_by=%s)""", (webnotes.session.user, webnotes.session.user)) return incomplete_todos[0][0] diff --git a/webnotes/patches/4_0/set_todo_checked_as_closed.py b/webnotes/patches/4_0/set_todo_checked_as_closed.py index be84346da6..730811d557 100644 --- a/webnotes/patches/4_0/set_todo_checked_as_closed.py +++ b/webnotes/patches/4_0/set_todo_checked_as_closed.py @@ -1,4 +1,5 @@ import webnotes def execute(): + webnotes.reload_doc("core", "doctype", "todo") webnotes.conn.sql("""update tabToDo set status = if(ifnull(checked,0)=0, 'Open', 'Closed')""")