From 11ec2c50e0229713e597001baf3b0e9dfa01675c Mon Sep 17 00:00:00 2001 From: Saurabh Date: Fri, 17 Nov 2017 14:49:46 +0530 Subject: [PATCH 1/2] [fix] set default language in local --- .../v9_2/rename_translated_domains_in_en.py | 21 ++++++++++++------- 1 file changed, 13 insertions(+), 8 deletions(-) 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 88ffbb7a3d..168605d9a5 100644 --- a/erpnext/patches/v9_2/rename_translated_domains_in_en.py +++ b/erpnext/patches/v9_2/rename_translated_domains_in_en.py @@ -4,7 +4,9 @@ from frappe import _ def execute(): language = frappe.get_single("System Settings").language - if language.startswith('en'): return + if language and language.startswith('en'): return + + frappe.local.lang = language all_domains = frappe.get_hooks("domains") @@ -16,11 +18,14 @@ def execute(): domain_settings = frappe.get_single("Domain Settings") active_domains = [d.domain for d in domain_settings.active_domains] - for domain in active_domains: - domain = frappe.get_doc("Domain", domain) - domain.setup_domain() + try: + for domain in active_domains: + domain = frappe.get_doc("Domain", domain) + domain.setup_domain() - if int(frappe.db.get_single_value('System Settings', 'setup_complete')): - domain.setup_sidebar_items() - domain.setup_desktop_icons() - domain.set_default_portal_role() + if int(frappe.db.get_single_value('System Settings', 'setup_complete')): + domain.setup_sidebar_items() + domain.setup_desktop_icons() + domain.set_default_portal_role() + except frappe.LinkValidationError: + pass \ No newline at end of file From f773af6053c201ef79e0681fd05aa4a2ccb3ccb1 Mon Sep 17 00:00:00 2001 From: Saurabh Date: Fri, 17 Nov 2017 15:25:23 +0600 Subject: [PATCH 2/2] bumped to version 9.2.15 --- erpnext/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/__init__.py b/erpnext/__init__.py index d1e9417db1..30b021e090 100644 --- a/erpnext/__init__.py +++ b/erpnext/__init__.py @@ -4,7 +4,7 @@ import inspect import frappe from erpnext.hooks import regional_overrides -__version__ = '9.2.14' +__version__ = '9.2.15' def get_default_company(user=None): '''Get default company for user'''