Skip to content

Commit

Permalink
fix(setup): avoid duplicate entry for Analytics role (backport #40183) (
Browse files Browse the repository at this point in the history
#40185)

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

(cherry picked from commit 29f91a7)

Co-authored-by: Rucha Mahabal <ruchamahabal2@gmail.com>
  • Loading branch information
mergify[bot] and ruchamahabal authored Feb 29, 2024
1 parent 930df21 commit 9cb8d33
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion erpnext/setup/install.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@


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")
Expand Down

0 comments on commit 9cb8d33

Please sign in to comment.