From 751e36a5335b66246d73ab8a08453e63e214cad3 Mon Sep 17 00:00:00 2001 From: Rushabh Mehta Date: Tue, 22 Dec 2015 12:52:57 +0530 Subject: [PATCH] [messages] show notifications and fix double listing in dropdown --- frappe/desk/page/messages/messages.py | 3 +-- frappe/public/js/frappe/ui/toolbar/notifications.js | 5 +++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/frappe/desk/page/messages/messages.py b/frappe/desk/page/messages/messages.py index f450eec888..1c41b7adad 100644 --- a/frappe/desk/page/messages/messages.py +++ b/frappe/desk/page/messages/messages.py @@ -31,9 +31,9 @@ def get_list(arg=None): return frappe.db.sql("""select * from `tabComment` where (owner=%(contact)s or comment_docname=%(user)s + or (owner=comment_docname and ifnull(parenttype, "")!="Assignment") or owner=comment_docname) and comment_doctype ='Message' - and ifnull(parenttype, "")!="Assignment" order by creation desc limit %(limit_start)s, %(limit_page_length)s""", frappe.local.form_dict, as_dict=1) else: @@ -42,7 +42,6 @@ def get_list(arg=None): or (owner=%(user)s and comment_docname=%(contact)s) or (owner=%(contact)s and comment_docname=%(contact)s)) and comment_doctype ='Message' - and ifnull(parenttype, "")!="Assignment" order by creation desc limit %(limit_start)s, %(limit_page_length)s""", frappe.local.form_dict, as_dict=1) diff --git a/frappe/public/js/frappe/ui/toolbar/notifications.js b/frappe/public/js/frappe/ui/toolbar/notifications.js index ac1079e529..0cbb897a9e 100644 --- a/frappe/public/js/frappe/ui/toolbar/notifications.js +++ b/frappe/public/js/frappe/ui/toolbar/notifications.js @@ -23,8 +23,9 @@ frappe.ui.notifications.update_notifications = function() { // add to toolbar and sidebar $.each(doctypes, function(i, doctype) { - if(!in_list(["ToDo", "Comment", "Event"])) - frappe.ui.notifications.add_notification(doctype); + if(!in_list(["ToDo", "Comment", "Event"], doctype)) { + frappe.ui.notifications.add_notification(doctype); + } }); // set click events