mirror of
https://github.com/frappe/erpnext.git
synced 2026-08-24 20:46:38 +00:00
refactor: build document links with get_form_link in form scripts
This commit is contained in:
@@ -309,7 +309,9 @@ frappe.ui.form.on("BOM", {
|
||||
frm.set_intro(
|
||||
__("This is a Template BOM and will be used to make the work order for {0} of the item {1}", [
|
||||
`<a class="variants-intro">variants</a>`,
|
||||
`<a href="/app/item/${frm.doc.item}">${frm.doc.item}</a>`,
|
||||
`<a href="${frappe.utils.get_form_link("Item", frm.doc.item)}">${frappe.utils.escape_html(
|
||||
frm.doc.item
|
||||
)}</a>`,
|
||||
]),
|
||||
true
|
||||
);
|
||||
|
||||
@@ -290,7 +290,10 @@ frappe.ui.form.on("Item", {
|
||||
if (frm.doc.variant_of) {
|
||||
frm.set_intro(
|
||||
__("This Item is a Variant of {0} (Template).", [
|
||||
`<a href="/app/item/${frm.doc.variant_of}" onclick="location.reload()">${frm.doc.variant_of}</a>`,
|
||||
`<a href="${frappe.utils.get_form_link(
|
||||
"Item",
|
||||
frm.doc.variant_of
|
||||
)}" onclick="location.reload()">${frappe.utils.escape_html(frm.doc.variant_of)}</a>`,
|
||||
]),
|
||||
true
|
||||
);
|
||||
|
||||
@@ -174,7 +174,10 @@ frappe.ui.form.on("Shipment", {
|
||||
__("Email or Phone/Mobile of the Contact are mandatory to continue.") +
|
||||
"</br>" +
|
||||
__("Please set Email/Phone for the contact") +
|
||||
` <a href='/app/contact/${contact_name}'>${contact_name}</a>`
|
||||
` <a href="${frappe.utils.get_form_link(
|
||||
"Contact",
|
||||
contact_name
|
||||
)}">${frappe.utils.escape_html(contact_name)}</a>`
|
||||
);
|
||||
}
|
||||
let contact_display = r.message.contact_display;
|
||||
|
||||
Reference in New Issue
Block a user