Try ERPNext Try Frappe Cloud Buy Support Partners Foundation

Setup auto email KeyError: 'income'

Hi, I have setup auto email for profitability analysis. However, after updating to:
ERPNext: v12.19.0 (version-12)
Frappe Framework: v12.16.3 (version-12)
from previous version of v12

it does not send the email anymore but profitability analysis report work just fine. When I check on the auto email setup to download the html or “send now”, it generated this error:

 Server Error
Traceback (most recent call last):
  File "/home/frappe/frappe-bench/apps/frappe/frappe/app.py", line 67, in application
response = frappe.api.handle()
  File "/home/frappe/frappe-bench/apps/frappe/frappe/api.py", line 59, in handle
return frappe.handler.handle()
  File "/home/frappe/frappe-bench/apps/frappe/frappe/handler.py", line 24, in handle
data = execute_cmd(cmd)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/handler.py", line 64, in execute_cmd
return frappe.call(method, **frappe.form_dict)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/__init__.py", line 1074, in call
return fn(*args, **newargs)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/email/doctype/auto_email_report/auto_email_report.py", line 198, in download
data = auto_email_report.get_report_content()
  File "/home/frappe/frappe-bench/apps/frappe/frappe/email/doctype/auto_email_report/auto_email_report.py", line 96, in get_report_content
columns, data = make_links(columns, data)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/email/doctype/auto_email_report/auto_email_report.py", line 253, in make_links
row[col.fieldname] = frappe.format_value(row[col.fieldname], col)
KeyError: 'income'

Can anyone help me to resolve this issue?

It appears that errors only happens on html report.
Issue created