we have this error only for this item, when calling the stock balance.
Traceback (most recent call last):
File "/home/ubuntu/frappe-bench/apps/frappe/frappe/app.py", line 55, in application
response = frappe.handler.handle()
File "/home/ubuntu/frappe-bench/apps/frappe/frappe/handler.py", line 19, in handle
execute_cmd(cmd)
File "/home/ubuntu/frappe-bench/apps/frappe/frappe/handler.py", line 36, in execute_cmd
ret = frappe.call(method, **frappe.form_dict)
File "/home/ubuntu/frappe-bench/apps/frappe/frappe/__init__.py", line 879, in call
return fn(*args, **newargs)
File "/home/ubuntu/frappe-bench/apps/frappe/frappe/desk/query_report.py", line 88, in run
res = frappe.get_attr(method_name)(frappe._dict(filters))
File "/home/ubuntu/frappe-bench/apps/erpnext/erpnext/stock/report/stock_balance/stock_balance.py", line 21, in execute
data.append([item, item_map[item]["item_name"],
KeyError: u'ITEM-07961'
I can’t found any difference from this item to others.
Any clues?
EDIT: I realized, that this error occurs, when there are different ITEMs with the same “display name”.
Lets say I have ITEM-07960 and ITEM-07961, both are called “Apple MacBook”. I assume this is a problem for ERPNext, but It shouldn’t be, since the real key should always be the ITEM-Number.
I think it is related to wrong case (UPPER/lower) in Item code.
Can you please rename the item to a temporary name and then rename it to original again?
Trust you’re doing well. Could you please give some further insight into the cause of this issue? I’m asking because it has implications beyond the Stock Balance report. It also affects function of the POS! The item does not show up in POS when you search by Item Code and if you search by name, it comes up but cannot be selected and also shows wrong Stock Qty
Renaming the item solves all the aforementioned issues so the question is… why does this happen in the first place? For the particular item where we experienced this issue, the item name is written in UPPER case. I’m not sure if this had anything to do with it but we need to get to the bottom of this to avoid future issues please
Just a request suggestion to paste your traceback as text - that make it easier you and others to search the code, and also too the code then shows up in forum searches to direct others for clues…