[fix] make domain document

This commit is contained in:
Rushabh Mehta 2017-09-22 14:54:29 +05:30
parent 45e1649340
commit d233f65db0

View file

@ -754,7 +754,7 @@ def make_module_and_roles(doc, perm_fieldname="permissions"):
"""Make `Module Def` and `Role` records if already not made. Called while installing."""
try:
if doc.restrict_to_domain and not frappe.db.exists('Domain', doc.restrict_to_domain):
frappe.get_doc(doctype='Domain', domain=doc.restrict_to_domain).insert()
frappe.get_doc(dict(doctype='Domain', domain=doc.restrict_to_domain)).insert()
if not frappe.db.exists("Module Def", doc.module):
m = frappe.get_doc({"doctype": "Module Def", "module_name": doc.module})