Error on stock balance report

following error pops up while viewing stock

Traceback (most recent call last):
File “/home/erpdev/frappe-bench/apps/frappe/frappe/”, line 62, in application
response = frappe.handler.handle()
File “/home/erpdev/frappe-bench/apps/frappe/frappe/”, line 22, in handle
data = execute_cmd(cmd)
File “/home/erpdev/frappe-bench/apps/frappe/frappe/”, line 53, in execute_cmd
return, **frappe.form_dict)
File “/home/erpdev/frappe-bench/apps/frappe/frappe/”, line 939, in call
return fn(*args, **newargs)
File “/home/erpdev/frappe-bench/apps/frappe/frappe/desk/”, line 96, in run
res = frappe.get_attr(method_name)(frappe._dict(filters))
File “/home/erpdev/frappe-bench/apps/erpnext/erpnext/stock/report/stock_balance/”, line 29, in execute
report_data = [item, item_map[item][“item_name”],
KeyError: u’Hight Power Braided Super PE 135M’

The item mentioned has been deleted from the item table.
Do you need a more detailed explanation of when this error started appearing?

Please help.


The steps taken after which this error appeared are.

  1. by mistakenly merged a variant with a Template (should have a check to prevent this)
  2. could not delete the merged item or its sales or stock entry.
  3. had to force delete the item by removing it from database by query .
    4.deleted stock entry by query
    5.also deleted stock entry detail and stock entry ledger for that items from sql.

now i cant access the balance report with this error .

what are the corrective steps to be taken ?


Thanks for this informative content.