From b5e2d2aa9021ed54b207a94f2284c17f7ab97202 Mon Sep 17 00:00:00 2001 From: Rushabh Mehta Date: Tue, 5 Jul 2016 14:59:01 +0530 Subject: [PATCH] [fix] get_timeline_data --- frappe/desk/notifications.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/frappe/desk/notifications.py b/frappe/desk/notifications.py index c20acd563e..99a16b755b 100644 --- a/frappe/desk/notifications.py +++ b/frappe/desk/notifications.py @@ -188,19 +188,19 @@ def get_open_count(doctype, name): items.extend(group.get('items')) out = [] - for doctype in items: - filters = get_filters_for(doctype) - fieldname = links.get('non_standard_fieldnames', {}).get(doctype, links.fieldname) - data = {'name': doctype} + for d in items: + filters = get_filters_for(d) + fieldname = links.get('non_standard_fieldnames', {}).get(d, links.fieldname) + data = {'name': d} if filters: # get the fieldname for the current document # we only need open documents related to the current document filters[fieldname] = name - total = len(frappe.get_all(doctype, fields='name', + total = len(frappe.get_all(d, fields='name', filters=filters, limit=6, distinct=True, ignore_ifnull=True)) data['open_count'] = total - total = len(frappe.get_all(doctype, fields='name', + total = len(frappe.get_all(d, fields='name', filters={fieldname: name}, limit=10, distinct=True, ignore_ifnull=True)) data['count'] = total out.append(data)