Added Notification Control for caching notifications probably causing the freezing problem
diff --git a/startup/bean_handlers.py b/startup/bean_handlers.py
new file mode 100644
index 0000000..b121861
--- /dev/null
+++ b/startup/bean_handlers.py
@@ -0,0 +1,17 @@
+# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd.
+# License: GNU General Public License v3. See license.txt
+
+from home import update_feed
+from core.doctype.notification_count.notification_count import clear_doctype_notifications
+from stock.doctype.material_request.material_request import update_completed_qty
+
+def on_method(bean, method):
+ print method
+ if method in ("on_update", "on_submit"):
+ update_feed(bean.controller, method)
+
+ if method in ("on_update", "on_cancel", "on_trash"):
+ clear_doctype_notifications(bean.controller, method)
+
+ if bean.doc.doctype=="Stock Entry" and method in ("on_submit", "on_cancel"):
+ update_completed_qty(bean.controller, method)
\ No newline at end of file
diff --git a/startup/observers.py b/startup/observers.py
deleted file mode 100644
index df827da..0000000
--- a/startup/observers.py
+++ /dev/null
@@ -1,9 +0,0 @@
-# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd.
-# License: GNU General Public License v3. See license.txt
-
-observer_map = {
- "*:on_update": "home.update_feed",
- "*:on_submit": "home.update_feed",
- "Stock Entry:on_submit": "stock.doctype.material_request.material_request.update_completed_qty",
- "Stock Entry:on_cancel": "stock.doctype.material_request.material_request.update_completed_qty",
-}
\ No newline at end of file
diff --git a/startup/open_count.py b/startup/open_count.py
index 431ced9..bf29a32 100644
--- a/startup/open_count.py
+++ b/startup/open_count.py
@@ -56,6 +56,12 @@
AND ifnull(docstatus,0)=0
""", webnotes.user.name)[0][0]
+for_module_doctypes = {
+ "ToDo": "To Do",
+ "Event": "Calendar",
+ "Comment": "Messages"
+}
+
for_module = {
"To Do": get_things_todo,
"Calendar": get_todays_events,
diff --git a/startup/schedule_handlers.py b/startup/schedule_handlers.py
index 2ff7b6d..c2401ef 100644
--- a/startup/schedule_handlers.py
+++ b/startup/schedule_handlers.py
@@ -30,6 +30,10 @@
from core.doctype.event.event import send_event_digest
run_fn(send_event_digest)
+ # clear daily event notifications
+ from core.doctype.notification_count.notification_count import delete_notification_count_for
+ delete_notification_count_for("Event")
+
# email digest
from setup.doctype.email_digest.email_digest import send
run_fn(send)