diff --git a/erpnext/hooks.py b/erpnext/hooks.py index aaea9e712d4..f3ccc5783a7 100644 --- a/erpnext/hooks.py +++ b/erpnext/hooks.py @@ -256,7 +256,7 @@ standard_portal_menu_items = [ "role": "Customer", }, {"title": "Issues", "route": "/issues", "reference_doctype": "Issue", "role": "Customer"}, - {"title": "Addresses", "route": "/addresses", "reference_doctype": "Address"}, + {"title": "Addresses", "route": "/addresses", "reference_doctype": "Address", "role": "Customer"}, { "title": "Timesheets", "route": "/timesheets", diff --git a/erpnext/patches.txt b/erpnext/patches.txt index 5c7102b1ad7..eb80eb59354 100644 --- a/erpnext/patches.txt +++ b/erpnext/patches.txt @@ -430,3 +430,4 @@ erpnext.patches.v16_0.update_currency_exchange_settings_for_frankfurter #2025-12 erpnext.patches.v15_0.create_accounting_dimensions_in_advance_taxes_and_charges erpnext.patches.v16_0.set_ordered_qty_in_quotation_item erpnext.patches.v15_0.replace_http_with_https_in_sales_partner +erpnext.patches.v16_0.add_portal_redirects diff --git a/erpnext/patches/v16_0/add_portal_redirects.py b/erpnext/patches/v16_0/add_portal_redirects.py new file mode 100644 index 00000000000..3a3e553d2ea --- /dev/null +++ b/erpnext/patches/v16_0/add_portal_redirects.py @@ -0,0 +1,14 @@ +import frappe + + +def execute(): + if frappe.db.exists("Portal Menu Item", {"route": "/addresses", "reference_doctype": "Address"}) and ( + doc := frappe.get_doc("Portal Menu Item", {"route": "/addresses", "reference_doctype": "Address"}) + ): + doc.role = "Customer" + doc.save() + + website_settings = frappe.get_single("Website Settings") + website_settings.append("route_redirects", {"source": "addresses", "target": "address/list"}) + website_settings.append("route_redirects", {"source": "projects", "target": "project"}) + website_settings.save()