From 261c42186fb27e73e191640e5aab85734f716f6b Mon Sep 17 00:00:00 2001 From: Shariq Ansari <30859809+shariquerik@users.noreply.github.com> Date: Tue, 9 Mar 2021 20:28:00 +0530 Subject: [PATCH] fix: updating phone icon setup logic for readonly fields (#24787) * fix: updating phone icon setup logic for readonly fields * fix: sider fix --- erpnext/public/js/telephony.js | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/erpnext/public/js/telephony.js b/erpnext/public/js/telephony.js index b66126c2b8..9548d6c5f3 100644 --- a/erpnext/public/js/telephony.js +++ b/erpnext/public/js/telephony.js @@ -1,11 +1,18 @@ frappe.ui.form.ControlData = frappe.ui.form.ControlData.extend( { make_input() { - if (!this.df.read_only) { - this._super(); - } + this._super(); if (this.df.options == 'Phone') { this.setup_phone(); } + if (this.frm && this.frm.fields_dict) { + Object.values(this.frm.fields_dict).forEach(function(field) { + if (field.df.read_only === 1 && field.df.options === 'Phone' + && field.disp_area.style[0] != 'display' && !field.has_icon) { + field.setup_phone(); + field.has_icon = true; + } + }); + } }, setup_phone() { if (frappe.phone_call.handler) {