mirror of
https://github.com/frappe/erpnext.git
synced 2026-06-05 13:24:47 +00:00
* feat: remove permissions of Agriculture Manager and Agriculture User * feat: patch to remove agriculture roles * chore: formatting issue --------- Co-authored-by: ruthra kumar <ruthra@erpnext.com>
13 lines
400 B
Python
13 lines
400 B
Python
import frappe
|
|
|
|
|
|
def execute():
|
|
if "agriculture" in frappe.get_installed_apps():
|
|
return
|
|
|
|
for role in ["Agriculture User", "Agriculture Manager"]:
|
|
assignments = frappe.get_all("Has Role", {"role": role}, pluck="name")
|
|
for assignment in assignments:
|
|
frappe.delete_doc("Has Role", assignment, ignore_missing=True, force=True)
|
|
frappe.delete_doc("Role", role, ignore_missing=True, force=True)
|