brotherton-erpnext/erpnext/regional/address_template
Chillar Anand 915b34391c
chore: Clean up imports (#27302)
* chore: Added isort to pre-commit config

* chore: Sort imports with isort

* chore: Clean up imports with pycln

* chore: Sort imports with isort

* chore: Fix import issues

* chore: Clean up sider issues

* chore: Remove import errors from flake8 ignore list

* chore: Clean up lint issues
2021-09-02 16:44:59 +05:30
..
templates chore: mass trailing whitespace and EOF fixes 2021-08-19 13:43:28 +05:30
__init__.py feat(regional): a central place for regional address templates (#19862) 2020-04-08 08:56:57 +05:30
README.md feat(regional): a central place for regional address templates (#19862) 2020-04-08 08:56:57 +05:30
setup.py chore: mass trailing whitespace and EOF fixes 2021-08-19 13:43:28 +05:30
test_regional_address_template.py chore: Clean up imports (#27302) 2021-09-02 16:44:59 +05:30

To add an Address Template for your country, place a new file in this directory:

  • File name: your_country.html (lower case with underscores)
  • File content: a Jinja Template.

All the fields of Address (including Custom Fields, if any) will be available to the template. Example:

{{ address_line1 }}<br>
{% if address_line2 %}{{ address_line2 }}<br>{% endif -%}
{{ city }}<br>
{% if state %}{{ state }}<br>{% endif -%}
{% if pincode %} PIN:  {{ pincode }}<br>{% endif -%}
{{ country }}<br>
{% if phone %}Phone: {{ phone }}<br>{% endif -%}
{% if fax %}Fax: {{ fax }}<br>{% endif -%}
{% if email_id %}Email: {{ email_id }}<br>{% endif -%}