From 65b3356deefb30856696f32c71e8413740a86a41 Mon Sep 17 00:00:00 2001 From: Saurabh Date: Thu, 14 Dec 2017 16:52:50 +0530 Subject: [PATCH] [fix] merge case in rename_translated_domains_in_en #11879 (#12007) --- erpnext/patches/v9_2/rename_translated_domains_in_en.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/erpnext/patches/v9_2/rename_translated_domains_in_en.py b/erpnext/patches/v9_2/rename_translated_domains_in_en.py index 168605d9a5..c787b84239 100644 --- a/erpnext/patches/v9_2/rename_translated_domains_in_en.py +++ b/erpnext/patches/v9_2/rename_translated_domains_in_en.py @@ -13,7 +13,12 @@ def execute(): for domain in all_domains: translated_domain = _(domain, lang=language) 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") active_domains = [d.domain for d in domain_settings.active_domains]