Skip to content

Commit

Permalink
Merge branch 'hotfix'
Browse files Browse the repository at this point in the history
  • Loading branch information
mbauskar committed Jul 18, 2017
2 parents 113df55 + 823b3ca commit 8f42f60
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
2 changes: 1 addition & 1 deletion erpnext/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import frappe
from erpnext.hooks import regional_overrides

__version__ = '8.5.0'
__version__ = '8.5.1'

def get_default_company(user=None):
'''Get default company for user'''
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,5 @@ def execute():
""" set the restrict to domain in module def """

frappe.reload_doc("core", "doctype", "module_def")
update_module_def_restrict_to_domain()
if frappe.db.get_single_value('System Settings', 'setup_complete'):
update_module_def_restrict_to_domain()
10 changes: 8 additions & 2 deletions erpnext/setup/setup_wizard/domainify.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,8 +151,14 @@ def update_module_def_restrict_to_domain():
""" set the restrict to domain for the module def """

module_def_restrict_to_domain_mapper = {
"Schools": _('Education')
"Schools": 'Education'
}

lang = frappe.db.get_single_value("System Settings", "language") or "en"
for module, domain in module_def_restrict_to_domain_mapper.iteritems():
frappe.set_value("Module Def", module, "restrict_to_domain", domain)
if frappe.db.exists("Domain", _(domain, lang)):
frappe.set_value("Module Def", module, "restrict_to_domain", _(domain, lang))
elif frappe.db.exists("Domain", domain):
frappe.set_value("Module Def", module, "restrict_to_domain", domain)
else:
pass

0 comments on commit 8f42f60

Please sign in to comment.