feat(regional): a central place for regional address templates (#19862)
* feat: a central place for regional address templates
* set up address templates during install
* why don't the tests run?
* fix: remove unused variables, fix cwd
* fix: .get() dicts contents
* fix: choose the right default
* fix: fieldname is template, not html
* fix: import unittest
* fix: remove unnecessary code
* fix: ensure country exists
* fix: ensure country exists
* feat: test updating an existing template
* fix(regional): DuplicateEntryError in test_update_address_template
* refactor and set 'is_default'
* fix codacy
* fix: patch gst_fixes
* fix: patch update_address_template_for_india
Co-authored-by: Nabin Hait <nabinhait@gmail.com>
diff --git a/erpnext/regional/germany/setup.py b/erpnext/regional/germany/setup.py
index a547136..d6047e8 100644
--- a/erpnext/regional/germany/setup.py
+++ b/erpnext/regional/germany/setup.py
@@ -3,29 +3,4 @@
def setup(company=None, patch=True):
- if not patch:
- update_address_template()
-
-
-def update_address_template():
- """
- Read address template from file. Update existing Address Template or create a
- new one.
- """
- dir_name = os.path.dirname(__file__)
- template_path = os.path.join(dir_name, 'address_template.html')
-
- with open(template_path, 'r') as template_file:
- template_html = template_file.read()
-
- address_template = frappe.db.get_value('Address Template', 'Germany')
-
- if address_template:
- frappe.db.set_value('Address Template', 'Germany', 'template', template_html)
- else:
- # make new html template for Germany
- frappe.get_doc(dict(
- doctype='Address Template',
- country='Germany',
- template=template_html
- )).insert()
+ pass