fix: keep customer/supplier website role by default

This commit is contained in:
Ankush Menat 2023-10-16 16:53:43 +05:30
parent f59066c185
commit d2096cfdb7

View File

@ -33,6 +33,7 @@ def after_install():
add_app_name() add_app_name()
setup_log_settings() setup_log_settings()
hide_workspaces() hide_workspaces()
update_roles()
frappe.db.commit() frappe.db.commit()
@ -232,6 +233,12 @@ def hide_workspaces():
frappe.db.set_value("Workspace", ws, "public", 0) frappe.db.set_value("Workspace", ws, "public", 0)
def update_roles():
website_user_roles = ("Customer", "Supplier")
for role in website_user_roles:
frappe.db.set_value("Role", role, "desk_access", 0)
def create_default_role_profiles(): def create_default_role_profiles():
for role_profile_name, roles in DEFAULT_ROLE_PROFILES.items(): for role_profile_name, roles in DEFAULT_ROLE_PROFILES.items():
role_profile = frappe.new_doc("Role Profile") role_profile = frappe.new_doc("Role Profile")