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>
This commit is contained in:
@@ -8,9 +8,11 @@ import frappe, os, json
|
||||
from frappe import _
|
||||
from frappe.desk.page.setup_wizard.setup_wizard import make_records
|
||||
from frappe.utils import cstr, getdate
|
||||
from erpnext.accounts.doctype.account.account import RootNotEditable
|
||||
from frappe.desk.doctype.global_search_settings.global_search_settings import update_global_search_doctypes
|
||||
|
||||
from erpnext.accounts.doctype.account.account import RootNotEditable
|
||||
from erpnext.regional.address_template.setup import set_up_address_templates
|
||||
|
||||
default_lead_sources = ["Existing Customer", "Reference", "Advertisement",
|
||||
"Cold Calling", "Exhibition", "Supplier Reference", "Mass Mailing",
|
||||
"Customer's Vendor", "Campaign", "Walk In"]
|
||||
@@ -30,7 +32,7 @@ def install(country=None):
|
||||
{ 'doctype': 'Domain', 'domain': 'Agriculture'},
|
||||
{ 'doctype': 'Domain', 'domain': 'Non Profit'},
|
||||
|
||||
# address template
|
||||
# ensure at least an empty Address Template exists for this Country
|
||||
{'doctype':"Address Template", "country": country},
|
||||
|
||||
# item group
|
||||
@@ -269,12 +271,11 @@ def install(country=None):
|
||||
|
||||
# Records for the Supplier Scorecard
|
||||
from erpnext.buying.doctype.supplier_scorecard.supplier_scorecard import make_default_records
|
||||
|
||||
make_default_records()
|
||||
|
||||
make_records(records)
|
||||
|
||||
set_up_address_templates(default_country=country)
|
||||
set_more_defaults()
|
||||
|
||||
update_global_search_doctypes()
|
||||
|
||||
# path = frappe.get_app_path('erpnext', 'regional', frappe.scrub(country))
|
||||
|
||||
Reference in New Issue
Block a user