瀏覽代碼

[fix] get_timeline_data

version-14
Rushabh Mehta 9 年之前
父節點
當前提交
b5e2d2aa90
共有 1 個檔案被更改,包括 6 行新增6 行删除
  1. +6
    -6
      frappe/desk/notifications.py

+ 6
- 6
frappe/desk/notifications.py 查看文件

@@ -188,19 +188,19 @@ def get_open_count(doctype, name):
items.extend(group.get('items')) items.extend(group.get('items'))


out = [] 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: if filters:
# get the fieldname for the current document # get the fieldname for the current document
# we only need open documents related to the current document # we only need open documents related to the current document
filters[fieldname] = name 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)) filters=filters, limit=6, distinct=True, ignore_ifnull=True))
data['open_count'] = total 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)) filters={fieldname: name}, limit=10, distinct=True, ignore_ifnull=True))
data['count'] = total data['count'] = total
out.append(data) out.append(data)


Loading…
取消
儲存