Edit custom print format and fetch data from other doctype

Hello Guys,

I am doing a print format with custom HTML, Where i need to customize customer billing address field in the sales invoice as my need.

So, Added a custom script there.

<!-- here i want fetch data from other doctype “Address” ----->

{%- for row in frappe.get_list(doctype=“Address”,
fields=[“address_line1”, “address_line2”],
filters={ “link_name”:doc.customer_address}) -%}

{% endfor %}


{{ row.address_line1 }}

{% if row.address_line1 %} {{ row.address_line1 }} {% endif -%}. {% if row.address_line2 %}
{{ row.address_line2 }}. {% endif -%}

However, The address still shows Blank.Kindly help me out to fix this problem.