add german module with address template

This commit is contained in:
Raffael Meyer 2019-01-27 23:32:41 +01:00
parent f1ff5c24ff
commit 1f72b44f12
3 changed files with 29 additions and 0 deletions

View File

View File

@ -0,0 +1,8 @@
{{ address_line1 }}<br>
{% if address_line2 %}{{ address_line2 }}<br>{% endif -%}
{{ pincode }} {{ city }}<br>
{% if country %}{{ country }}<br>{% endif -%}
<br>
{% if phone %}Tel: {{ phone }}<br>{% endif -%}
{% if fax %}Fax: {{ fax }}<br>{% endif -%}
{% if email_id %}E-Mail: {{ email_id }}<br>{% endif -%}

View File

@ -0,0 +1,21 @@
import frappe, os
def setup(company=None, patch=True):
if not patch:
update_address_template()
def update_address_template():
with open(os.path.join(os.path.dirname(__file__), 'address_template.html'), 'r') as f:
html = f.read()
address_template = frappe.db.get_value('Address Template', 'Germany')
if address_template:
frappe.db.set_value('Address Template', 'Germany', 'template', html)
else:
# make new html template for Germany
frappe.get_doc(dict(
doctype='Address Template',
country='Germany',
template=html
)).insert()