[fix] merge case in rename_translated_domains_in_en #11879 (#12007)

This commit is contained in:
Saurabh 2017-12-14 16:52:50 +05:30 committed by Nabin Hait
parent 2b95a5438b
commit 65b3356dee

View File

@ -13,7 +13,12 @@ def execute():
for domain in all_domains: for domain in all_domains:
translated_domain = _(domain, lang=language) translated_domain = _(domain, lang=language)
if frappe.db.exists("Domain", translated_domain): if frappe.db.exists("Domain", translated_domain):
frappe.rename_doc("Domain", translated_domain, domain, ignore_permissions=True, merge=True) #if domain already exists merged translated_domain and domain
merge = False
if frappe.db.exists("Domain", domain):
merge=True
frappe.rename_doc("Domain", translated_domain, domain, ignore_permissions=True, merge=merge)
domain_settings = frappe.get_single("Domain Settings") domain_settings = frappe.get_single("Domain Settings")
active_domains = [d.domain for d in domain_settings.active_domains] active_domains = [d.domain for d in domain_settings.active_domains]