Hi there,
i’m trying to get company address from html template, any hint?
Thx
Hi there,
i’m trying to get company address from html template, any hint?
Thx
Anyone has the same prob?
@Mohammed_Redha Yup …it is changed in version 8 …now the field is address_html and display addresses from Address DocType …it seems kind of complicated to retrieve Company
address …
i’ve tried to use:
But getting an error:
("'dict object' has no attribute 'geo'",)
Can someone help on this? It’s really frustrating …
Hi @JoEz,
I know this is far from pretty but it worked for me:
{% set links = frappe.get_all('Dynamic Link', filters={'link_doctype': 'Company', 'link_name': doc.company, 'parenttype': 'Address'}, fields=['parent']) %}
{% if links %}
{% set address = frappe.get_doc("Address", links[0].parent) %}
{% endif %}
Playing with the filters helps if there are multiple addresses. Hope it helps…
{% set links = frappe.get_all(‘Dynamic Link’, filters={‘link_doctype’: ‘Company’, ‘link_name’: doc.company, ‘parenttype’: ‘Address’}, fields=[‘parent’]) %}
{% if links %}
{{frappe.db.get_value(“Address”, links[0].parent, “address_line1”)}}
{% endif %}
its working
{{ doc. address_display or ‘’ }}