From 64b4764c5c0b24c3ef3156d367863ce248bfe0eb Mon Sep 17 00:00:00 2001 From: Charles-Henri Decultot Date: Wed, 24 Jan 2024 18:46:14 +0100 Subject: [PATCH] fix: Auto set SIREN in 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 7d729658f78..6b5254c84c3 100644 --- a/erpnext/public/js/utils/contact_address_quick_entry.js +++ b/erpnext/public/js/utils/contact_address_quick_entry.js @@ -16,6 +16,7 @@ frappe.ui.form.ContactAddressQuickEntryForm = class ContactAddressQuickEntryForm } async render_dialog() { + const me = this; this.mandatory = this.mandatory.concat(this.get_variant_fields()); for (const m of this.mandatory) { @@ -27,12 +28,12 @@ frappe.ui.form.ContactAddressQuickEntryForm = class ContactAddressQuickEntryForm }; } - m.onchange = () => { - const selection = this._data.filter(f => f.value == this.dialog.get_value("company_search")) + m.onchange = function() { + const selection = this._data.filter(f => f.value == me.dialog.get_value("company_search")) if (selection.length) { const selected_company = selection[0] - this.dialog.set_values({ + me.dialog.set_values({ customer_name: selected_company.label, siren_number: selected_company.value }) -- GitLab