How to get the Supplier Address When Printing PDFs in Request for Quotation (RFQ)?

I’m trying to get the Supplier’s Address in “Request for Quotation” Print Format. So far I was only able to get the Supplier name only when trying to Print PDFs for Individual Suppliers (When there are multiple Suppliers in an RFQ).

Things that I’ve tried;

  1. Drag and Drop “Supplier” Field from normal Print Format (Only displays the name of the Supplier).
  2. Custom HTML,
{% set address = frappe.db.get_value("Supplier", doc.supplier, "primary_address") %}
<p><strong>Supplier Address:</strong> {{ address or "Not Available" }}</p>

Displays the last updated Supplier from the Supplier DocType, (doesn’t relate to the RFQ).

Current Print Format Result below

Any Solutions for this?

Workaround solution;

<p>Supplier: {{doc.vendor}}</p>

{% set supplier = frappe.get_doc("Supplier", doc.vendor) %}
{% set address_links = frappe.get_all("Dynamic Link", filters={"link_doctype": "Supplier", "link_name": supplier.name, "parenttype": "Address"}, fields=["parent"]) %}

{% if address_links %}
  {% set address = frappe.get_doc("Address", address_links[0].parent) %}
  <p>Supplier Address: {{ address.address_line1 }},
  {{ address.city }},
  {{ address.country }}</p>
{% else %}
  <p>No address found for this supplier.</p>
{% endif %}