ERPNext Conference 2019* ERPNext.com Blog

V12 Print Format Builder - IndexError: list index out of range


#1

Running on erpnext v12.1.1 and experiencing this issue when trying to edit and save a custom print format with the print format builder.

IndexError: list index out of range

Here’s what comes up in frappe.log

Site: RETRACTED
Form Dict: {
 "cmd": "frappe.client.set_value",
 "doctype": "Print Format",
 "fieldname": "format_data",
 "name": "Booking confirmation",
 "value": "[{\"fieldname\":\"print_heading_template\",\"fieldtype\":\"Custom HTML\",\"options\":\"<div class=\\\"print-heading\\\">\\t\\t\\t\\t<h2>Bo$
}
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/frappe/frappe/client.py", line 122, in set_value
    child = doc.getone({"doctype": doctype, "name": name})
  File "/home/frappe/frappe-bench/apps/frappe/frappe/model/base_document.py", line 130, in getone
    return self.get(key, filters=filters, limit=1)[0]
IndexError: list index out of range

Anyone else has this issue ?

Reported on github here: https://github.com/frappe/erpnext/issues/18999


#2

Can you give code snippet here?


#3

Sorry I am not sure what code snippet you are talking about … this is just a normal print format created out of the event doctype.


#4

This continues to be an issue and a potential bug - anyone has any information ?


#5

Hi @Iulian_Olaru

Did you find a solution to this? Just encountered the same error!

Thanks


#6

Couldn’t find the bug nor the solution.

But I worked around it by creating a new print format and that one works very well and the error does not appear anymore.


#7

Great, thanks! Was just considering doing exactly that! :blush:

Kind regards,