fix: addresses portal (backport #52712) (#52786)

* fix: addresses portal

(cherry picked from commit e317ab1479)

# Conflicts:
#	erpnext/patches.txt

* chore: resolve conflicts

---------

Co-authored-by: Mihir Kandoi <kandoimihir@gmail.com>
This commit is contained in:
mergify[bot]
2026-02-19 04:11:04 +00:00
committed by GitHub
parent b6a2284003
commit d7b61b945f
3 changed files with 16 additions and 1 deletions

View File

@@ -270,7 +270,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",

View File

@@ -465,3 +465,4 @@ erpnext.patches.v16_0.migrate_transaction_deletion_task_flags_to_status # 2
erpnext.patches.v16_0.update_company_custom_field_in_bin
erpnext.patches.v15_0.replace_http_with_https_in_sales_partner
erpnext.patches.v15_0.delete_quotation_lost_record_detail
erpnext.patches.v16_0.add_portal_redirects

View File

@@ -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()