Version 5 - no sales order journal_entries field?

OK so I have a number of references in my custom print format for Sales Invoice fetching Sales Order Journal Entries like this:

{{ frappe.db.get_value('Sales Order', doc.journal_entries[0].sales_order, 'name') }}

But I get an error

UndefinedError: 'erpnext.accounts.doctype.sales_invoice.sales_invoice.SalesInvoice object' has no attribute 'journal_entries'

Where has this field gone and what other field can I use to fetch my sales order values please???

Thanks.

@monojoker all table fieldnames were renamed for better consistency

journal_entries is now advances

check fieldnames from Customize Form View

You should use doc.items[0].sales_order

I tried advances_paid as I don’t see sales_order.advances anywhere and got the same error. I will try Nabin’s suggestion, thanks guys.