fix(shipment): user contact validation to use full name

(cherry picked from commit 3c6eb9a531)
This commit is contained in:
harrishragavan
2026-01-27 09:28:24 +05:30
committed by Mergify
parent c2f666b7a3
commit 0a56647a61

View File

@@ -261,9 +261,9 @@ frappe.ui.form.on("Shipment", {
frappe.db.get_value(
"User",
{ name: frappe.session.user },
["full_name", "last_name", "email", "phone", "mobile_no"],
["full_name", "email", "phone", "mobile_no"],
(r) => {
if (!(r.last_name && r.email && (r.phone || r.mobile_no))) {
if (!(r.full_name && r.email && (r.phone || r.mobile_no))) {
if (delivery_type == "Delivery") {
frm.set_value("delivery_company", "");
frm.set_value("delivery_contact", "");
@@ -272,9 +272,9 @@ frappe.ui.form.on("Shipment", {
frm.set_value("pickup_contact", "");
}
frappe.throw(
__("Last Name, Email or Phone/Mobile of the user are mandatory to continue.") +
__("Full Name, Email or Phone/Mobile of the user are mandatory to continue.") +
"</br>" +
__("Please first set Last Name, Email and Phone for the user") +
__("Please first set Full Name, Email and Phone for the user") +
` <a href="/app/user/${frappe.session.user}">${frappe.session.user}</a>`
);
}