fix: patch to add guardian role if not exists

This commit is contained in:
Saurabh 2019-01-30 11:48:39 +05:30
parent 25e63e806c
commit 5c12490709
3 changed files with 11 additions and 0 deletions

View File

@ -584,3 +584,4 @@ erpnext.patches.v11_0.rename_bom_wo_fields
erpnext.patches.v11_0.rename_additional_salary_component_additional_salary
erpnext.patches.v11_0.renamed_from_to_fields_in_project
erpnext.patches.v11_0.add_permissions_in_gst_settings
erpnext.patches.v11_1.setup_guardian_role

View File

View File

@ -0,0 +1,10 @@
from __future__ import unicode_literals
import frappe
def execute():
if 'Education' in frappe.get_active_domains() and not frappe.db.exists("Role", "Guardian"):
frappe.new_doc({
"doctype": "Role",
"role_name": "Guardian",
"desk_access": 0
}).insert(ignore_permissions=True)