[fix] do not count comments on for listview
This commit is contained in:
parent
3661bbafab
commit
d069e1603c
1 changed files with 2 additions and 20 deletions
|
|
@ -458,24 +458,6 @@ class DatabaseQuery(object):
|
|||
if not r.name:
|
||||
continue
|
||||
|
||||
r._comment_count = 0
|
||||
if "_comments" in r:
|
||||
comment_count = len(json.loads(r._comments or "[]"))
|
||||
else:
|
||||
comment_count = cint(frappe.db.get_value("Communication",
|
||||
filters={
|
||||
"communication_type": "Comment",
|
||||
"reference_doctype": self.doctype,
|
||||
"reference_name": r.name,
|
||||
"comment_type": "Comment"
|
||||
},
|
||||
fieldname="count(name)"))
|
||||
|
||||
communication_count = cint(frappe.db.get_value("Communication",
|
||||
filters={
|
||||
"communication_type": "Communication",
|
||||
"reference_doctype": self.doctype,
|
||||
"reference_name": r.name
|
||||
},
|
||||
fieldname="count(name)"))
|
||||
|
||||
r._comment_count = comment_count + communication_count
|
||||
r._comment_count = len(json.loads(r._comments or "[]"))
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue