chore: Remove agriculture roles (#47335)

* 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>
This commit is contained in:
maasanto
2025-05-26 13:45:46 +02:00
committed by GitHub
parent def9d8c9e0
commit b7de5398a7
3 changed files with 16 additions and 24 deletions

View File

@@ -143,7 +143,7 @@
],
"is_tree": 1,
"links": [],
"modified": "2025-01-22 10:47:32.581537",
"modified": "2025-04-29 13:53:13.488906",
"modified_by": "Administrator",
"module": "Assets",
"name": "Location",
@@ -198,34 +198,13 @@
"role": "Stock Manager",
"share": 1,
"write": 1
},
{
"create": 1,
"delete": 1,
"email": 1,
"export": 1,
"print": 1,
"read": 1,
"report": 1,
"role": "Agriculture Manager",
"share": 1,
"write": 1
},
{
"email": 1,
"export": 1,
"print": 1,
"read": 1,
"report": 1,
"role": "Agriculture User",
"share": 1,
"write": 1
}
],
"quick_entry": 1,
"row_format": "Dynamic",
"show_name_in_global_search": 1,
"sort_field": "creation",
"sort_order": "DESC",
"states": [],
"track_changes": 1
}
}

View File

@@ -414,3 +414,4 @@ erpnext.patches.v15_0.update_journal_entry_type
erpnext.patches.v15_0.set_grand_total_to_default_mop
execute:frappe.db.set_single_value("Accounts Settings", "use_new_budget_controller", True)
erpnext.patches.v15_0.rename_group_by_to_categorize_by_in_custom_reports
erpnext.patches.v15_0.remove_agriculture_roles

View File

@@ -0,0 +1,12 @@
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)