Skip to content

Commit

Permalink
Merge pull request #32686 from frappe/mergify/bp/version-14-hotfix/pr…
Browse files Browse the repository at this point in the history
…-32650

fix: unset contact details (backport #32650)
  • Loading branch information
deepeshgarg007 committed Oct 23, 2022
2 parents eb6db59 + d7a65b1 commit 1890445
Showing 1 changed file with 17 additions and 8 deletions.
25 changes: 17 additions & 8 deletions erpnext/public/js/utils/party.js
Expand Up @@ -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) {
Expand Down

0 comments on commit 1890445

Please sign in to comment.