fix(setup): avoid duplicate entry for Analytics role (backport #40183) (#40185)

fix(setup): avoid duplicate entry for Analytics role (#40183)

(cherry picked from commit 29f91a7919)

Co-authored-by: Rucha Mahabal <ruchamahabal2@gmail.com>
This commit is contained in:
mergify[bot]
2024-02-29 11:09:24 +05:30
committed by GitHub
parent 930df21a5f
commit 9cb8d33923

View File

@@ -20,7 +20,9 @@ default_mail_footer = """<div style="padding: 7px; text-align: right; color: #88
def after_install():
frappe.get_doc({"doctype": "Role", "role_name": "Analytics"}).insert()
if not frappe.db.exists("Role", "Analytics"):
frappe.get_doc({"doctype": "Role", "role_name": "Analytics"}).insert()
set_single_defaults()
create_print_setting_custom_fields()
add_all_roles_to("Administrator")