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

This commit is contained in:
Rucha Mahabal 2024-02-29 10:53:30 +05:30 committed by GitHub
parent f6fdfd2c01
commit 29f91a7919
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

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