[hotfix] set_restrict_to_domain_for_module_def patch fixes (#9921)
This commit is contained in:
parent
113df55e64
commit
5e75e3ba03
@ -10,4 +10,5 @@ def execute():
|
|||||||
""" set the restrict to domain in module def """
|
""" set the restrict to domain in module def """
|
||||||
|
|
||||||
frappe.reload_doc("core", "doctype", "module_def")
|
frappe.reload_doc("core", "doctype", "module_def")
|
||||||
|
if frappe.db.get_single_value('System Settings', 'setup_complete'):
|
||||||
update_module_def_restrict_to_domain()
|
update_module_def_restrict_to_domain()
|
@ -151,8 +151,14 @@ def update_module_def_restrict_to_domain():
|
|||||||
""" set the restrict to domain for the module def """
|
""" set the restrict to domain for the module def """
|
||||||
|
|
||||||
module_def_restrict_to_domain_mapper = {
|
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():
|
for module, domain in module_def_restrict_to_domain_mapper.iteritems():
|
||||||
|
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)
|
frappe.set_value("Module Def", module, "restrict_to_domain", domain)
|
||||||
|
else:
|
||||||
|
pass
|
||||||
|
Loading…
x
Reference in New Issue
Block a user