From 21b8ad6aa5f7ea5b59353e48429a8d7d0f76bf53 Mon Sep 17 00:00:00 2001 From: Marc Ramser Date: Mon, 31 Mar 2025 10:32:36 +0200 Subject: [PATCH] feat(regional): Address Template for Germany & Add Switzerland Template (#46737) * Add Address template for Switzerland * Fix address template for germany If an ERPNext instance is set to German and used by a business outside Germany (e.g., in Switzerland or Austria), customer addresses in Germany are displayed in their national format. However, for postal services, the international format (including the country) is required.". This is just a workaround. IMHO the correct fix would be to check where the company is located and based on that use the national or the international template. --- erpnext/regional/address_template/templates/germany.html | 8 ++------ .../regional/address_template/templates/switzerland.html | 4 ++++ 2 files changed, 6 insertions(+), 6 deletions(-) create mode 100644 erpnext/regional/address_template/templates/switzerland.html diff --git a/erpnext/regional/address_template/templates/germany.html b/erpnext/regional/address_template/templates/germany.html index 25c9c9d32e6..3886bfadc0b 100644 --- a/erpnext/regional/address_template/templates/germany.html +++ b/erpnext/regional/address_template/templates/germany.html @@ -1,8 +1,4 @@ {{ address_line1 }}
{% if address_line2 %}{{ address_line2 }}
{% endif -%} -{% if country in ["Germany", "Deutschland"] %} - {{ pincode }} {{ city }} -{% else %} - {{ pincode }} {{ city | upper }}
- {{ country | upper }} -{% endif %} +{{ pincode }} {{ city | upper }}
+{{ country | upper }} diff --git a/erpnext/regional/address_template/templates/switzerland.html b/erpnext/regional/address_template/templates/switzerland.html new file mode 100644 index 00000000000..3886bfadc0b --- /dev/null +++ b/erpnext/regional/address_template/templates/switzerland.html @@ -0,0 +1,4 @@ +{{ address_line1 }}
+{% if address_line2 %}{{ address_line2 }}
{% endif -%} +{{ pincode }} {{ city | upper }}
+{{ country | upper }}