mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-27 08:54:45 +00:00
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:
@@ -143,7 +143,7 @@
|
|||||||
],
|
],
|
||||||
"is_tree": 1,
|
"is_tree": 1,
|
||||||
"links": [],
|
"links": [],
|
||||||
"modified": "2025-01-22 10:47:32.581537",
|
"modified": "2025-04-29 13:53:13.488906",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "Assets",
|
"module": "Assets",
|
||||||
"name": "Location",
|
"name": "Location",
|
||||||
@@ -198,31 +198,10 @@
|
|||||||
"role": "Stock Manager",
|
"role": "Stock Manager",
|
||||||
"share": 1,
|
"share": 1,
|
||||||
"write": 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,
|
"quick_entry": 1,
|
||||||
|
"row_format": "Dynamic",
|
||||||
"show_name_in_global_search": 1,
|
"show_name_in_global_search": 1,
|
||||||
"sort_field": "creation",
|
"sort_field": "creation",
|
||||||
"sort_order": "DESC",
|
"sort_order": "DESC",
|
||||||
|
|||||||
@@ -414,3 +414,4 @@ erpnext.patches.v15_0.update_journal_entry_type
|
|||||||
erpnext.patches.v15_0.set_grand_total_to_default_mop
|
erpnext.patches.v15_0.set_grand_total_to_default_mop
|
||||||
execute:frappe.db.set_single_value("Accounts Settings", "use_new_budget_controller", True)
|
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.rename_group_by_to_categorize_by_in_custom_reports
|
||||||
|
erpnext.patches.v15_0.remove_agriculture_roles
|
||||||
|
|||||||
12
erpnext/patches/v15_0/remove_agriculture_roles.py
Normal file
12
erpnext/patches/v15_0/remove_agriculture_roles.py
Normal 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)
|
||||||
Reference in New Issue
Block a user