Hi,
has anybody experienced this issue, trying to scrap an asset results in
Server Error
IndexError: list index out of range
Issue is persistent through upgrade, maybe somebody has a remedy?
Hi,
has anybody experienced this issue, trying to scrap an asset results in
Server Error
IndexError: list index out of range
Issue is persistent through upgrade, maybe somebody has a remedy?
Assuming you are self hosted, on the server check say here frappe-bench/logs/* for a traceback with details of the error.
Copy and paste that here for all to benefit and troubleshoot this thanks
@clarkej Thank you for your reply
[ERROR] 2019-09-25 12:35:19,426 | /home/frappe/frappe-bench/apps/frappe/frappe/app.py:
Site: site1.local
Form Dict: {
“asset_name”: “000005”,
“cmd”: “erpnext.assets.doctype.asset.depreciation.scrap_asset”
}
Request Error
Traceback (most recent call last):
File “/home/frappe/frappe-bench/apps/frappe/frappe/app.py”, line 60, in application
response = frappe.api.handle()
File “/home/frappe/frappe-bench/apps/frappe/frappe/api.py”, line 55, in handle
return frappe.handler.handle()
File “/home/frappe/frappe-bench/apps/frappe/frappe/handler.py”, line 21, in handle
data = execute_cmd(cmd)
File “/home/frappe/frappe-bench/apps/frappe/frappe/handler.py”, line 56, in execute_cmd
return frappe.call(method, **frappe.form_dict)
File “/home/frappe/frappe-bench/apps/frappe/frappe/init.py”, line 1036, in call
return fn(*args, **newargs)
File “/home/frappe/frappe-bench/apps/erpnext/erpnext/assets/doctype/asset/depreciation.py”, line 149, in scrap_asset
for entry in get_gl_entries_on_asset_disposal(asset):
File “/home/frappe/frappe-bench/apps/erpnext/erpnext/assets/doctype/asset/depreciation.py”, line 191, in get_gl_entries_on_asset_disposal
value_after_depreciation = asset.finance_books[idx - 1].value_after_depreciation
IndexError: list index out of range
Thanks, that code is new and released in 12.1.5 (I think) fix: incorrect value booked in the accumulated depreciation account on sell of the asset by rohitwaghchaure · Pull Request #18104 · frappe/erpnext · GitHub
To that PR I added a link to this discussion for rohit_w to respond.
Thank you very much!
But sadly this issue was also at v12.0.4 , I was hoping that it would get patched as the v12 was very new at that time
After adding depreciations, this issue no longer occurs!