Error when viewing Sales Invoice- Key Error: '_comment_count'

Traceback (most recent call last):
File “/home/frappe/frappe-bench/apps/frappe/frappe/”, line 55, in application
response = frappe.handler.handle()
File “/home/frappe/frappe-bench/apps/frappe/frappe/”, line 19, in handle
File “/home/frappe/frappe-bench/apps/frappe/frappe/”, line 40, in execute_cmd
ret =, **frappe.form_dict)
File “/home/frappe/frappe-bench/apps/frappe/frappe/”, line 897, in call
return fn(*args, **newargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/desk/”, line 17, in get
data = compress(execute(**args), args = args)
File “/home/frappe/frappe-bench/apps/frappe/frappe/desk/”, line 53, in compress
KeyError: ‘_comment_count’

Hi @eLearningzw

Not able to replicate on local account, can you share some steps?
Also please share the applications version

Hi @rohit_w

erpnext 7.2.21
frappe 7.2.17

The error just started appearing when one of the users was trying to view the Sales Invoice list. What does this error mean and how can I resolve it?

Hai elearningzw,

I am also facing the same issue right now. Did u got the solution regarding the solution. please share is you get the solution.hope you will.

Thanks and regards,
siva sai krishna.