Print Timesheets on Sales Invoice Missing Fields

Hello,

Running

ERPNext: v11.1.67 (version-11)

Frappe Framework: v11.1.61 (version-11)

I added a custom checkbox Print Timesheets to the Sales Invoice form and then added this code to the print format:

{% if doc.timesheets and doc.print_timesheets -%}

{{ _("Timesheets") }}

{% for ts in doc.timesheets %} {% endfor %}
{{ _("Sr") }} {{ _("Date") }} {{ _("Note") }} {{ _("Hours") }}
{{ loop.index }}
{{ frappe.utils.formatdate(ts.start_date) }}
{{ ts.note }}
{{ ts.billing_hours | round(2, 'ceil') }}
{% endif %}`

The print format shows the timesheets when the checkbox is selected, however, I get this where I expect the timesheet note to be:

{{ no such element: erpnext.accounts.doctype.sales_invoice_timesheet.sales_invoice_timesheet.SalesInvoiceTimesheet object[‘note’] }}

There is also not data listed in the table.

How can I grab these fields from the timesheets to display them properly on the printout?

Thanks for any help!

try moving this to just above the “endif” line