fix: improve condition for routing to newly created doc's form (#37849)

* fix: routing issue

* fix: commit suggestion

Co-authored-by: Sagar Vora <16315650+sagarvora@users.noreply.github.com>

---------

Co-authored-by: Shankarv19bcr <shankarv292002@gmail.com>
Co-authored-by: Sagar Vora <16315650+sagarvora@users.noreply.github.com>
This commit is contained in:
Kerolles Fathy 2026-03-11 07:17:50 +02:00 committed by GitHub
parent 78a9d823ea
commit 5ca45fbe72
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1355,7 +1355,11 @@ frappe.ui.form.Form = class FrappeForm {
frappe.re_route[frappe.router.get_sub_path()] = `${encodeURIComponent(
frappe.router.slug(this.doctype)
)}/${encodeURIComponent(name)}`;
!frappe._from_link && frappe.set_route("Form", this.doctype, name);
// Skip routing only when the document is created from a Form view's Link field
if (!frappe._from_link?.field_obj?.frm) {
frappe.set_route("Form", this.doctype, name);
}
}
// ACTIONS