diff --git a/frappe/__init__.py b/frappe/__init__.py index 527b2d17a7..e9e4462fcc 100644 --- a/frappe/__init__.py +++ b/frappe/__init__.py @@ -14,7 +14,7 @@ import os, sys, importlib, inspect, json from .exceptions import * from .utils.jinja import get_jenv, get_template, render_template, get_email_from_template -__version__ = '9.2.10' +__version__ = '9.2.11' __title__ = "Frappe Framework" local = Local() diff --git a/frappe/core/doctype/domain/domain.py b/frappe/core/doctype/domain/domain.py index c6b1766235..fed9f2360d 100644 --- a/frappe/core/doctype/domain/domain.py +++ b/frappe/core/doctype/domain/domain.py @@ -36,6 +36,10 @@ class Domain(Document): '''Enable roles that are restricted to this domain''' if self.data.restricted_roles: for role_name in self.data.restricted_roles: + if not frappe.db.get_value('Role', role_name): + frappe.get_doc(dict(doctype='Role', role_name=role_name)).insert() + continue + role = frappe.get_doc('Role', role_name) role.disabled = 0 role.save() diff --git a/frappe/patches/v9_1/resave_domain_settings.py b/frappe/patches/v9_1/resave_domain_settings.py index fa9688ea53..1e70bf885c 100644 --- a/frappe/patches/v9_1/resave_domain_settings.py +++ b/frappe/patches/v9_1/resave_domain_settings.py @@ -1,7 +1,10 @@ import frappe def execute(): + domains = ['Education', 'Healthcare', 'Hospitality'] try: - frappe.get_single('Domain Settings').save() + for d in domains: + domain = frappe.get_doc('Domain', d) + domain.setup_domain() except frappe.LinkValidationError: - pass \ No newline at end of file + pass