Merge pull request #32650 from barredterra/unset-contact-details

fix: unset contact details
This commit is contained in:
Deepesh Garg 2022-10-23 18:21:01 +05:30 committed by GitHub
commit 77d509eb9a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -242,20 +242,29 @@ erpnext.utils.set_taxes = function(frm, triggered_from_field) {
});
};
erpnext.utils.get_contact_details = function(frm) {
erpnext.utils.get_contact_details = function (frm) {
if (frm.updating_party_details) return;
if (frm.doc["contact_person"]) {
frappe.call({
method: "frappe.contacts.doctype.contact.contact.get_contact_details",
args: {contact: frm.doc.contact_person },
callback: function(r) {
if (r.message)
frm.set_value(r.message);
}
})
args: { contact: frm.doc.contact_person },
callback: function (r) {
if (r.message) frm.set_value(r.message);
},
});
} else {
frm.set_value({
contact_person: "",
contact_display: "",
contact_email: "",
contact_mobile: "",
contact_phone: "",
contact_designation: "",
contact_department: "",
});
}
}
};
erpnext.utils.validate_mandatory = function(frm, label, value, trigger_on) {
if (!value) {