From 65e856792dd9d5641958b206cc26dbc550715db4 Mon Sep 17 00:00:00 2001 From: Charles-Henri Decultot Date: Tue, 16 Jan 2024 11:39:41 +0100 Subject: [PATCH] fix: Don't replace all properties in customer quick entry --- erpnext/public/js/utils/contact_address_quick_entry.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/erpnext/public/js/utils/contact_address_quick_entry.js b/erpnext/public/js/utils/contact_address_quick_entry.js index 952ebdfcfac..84179442590 100644 --- a/erpnext/public/js/utils/contact_address_quick_entry.js +++ b/erpnext/public/js/utils/contact_address_quick_entry.js @@ -26,7 +26,7 @@ frappe.ui.form.ContactAddressQuickEntryForm = class ContactAddressQuickEntryForm m.onchange = () => { const selection = this._data.filter(f => f.value == this.dialog.get_value("company_search")) - if (selection.length){ + if (selection.length) { const selected_company = selection[0] this.dialog.set_values({ customer_name: selected_company.label, @@ -47,8 +47,9 @@ frappe.ui.form.ContactAddressQuickEntryForm = class ContactAddressQuickEntryForm const original_df = frappe.meta.get_docfield(dt, fieldname); if (original_df) { const default_value = frappe.defaults.get_default(fieldname); - Object.assign(m, original_df, { - "depends_on": "", + Object.assign(m, { + "reqd": original_df.reqd, + "hidden": m.hidden ? 1 : original_df.hidden, "default": default_value, }); } -- GitLab