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

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:34:23 +05:30
committed by GitHub
parent 19a7b6d122
commit 035c90c3b8

View File

@@ -19,7 +19,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")