add german module with address template
This commit is contained in:
parent
f1ff5c24ff
commit
1f72b44f12
0
erpnext/regional/germany/__init__.py
Normal file
0
erpnext/regional/germany/__init__.py
Normal file
8
erpnext/regional/germany/address_template.html
Normal file
8
erpnext/regional/germany/address_template.html
Normal 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 -%}
|
21
erpnext/regional/germany/setup.py
Normal file
21
erpnext/regional/germany/setup.py
Normal 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()
|
Loading…
Reference in New Issue
Block a user