fix: Add phone icon on read only phone fields (#24680)
* fix: Add phone icon on read only phone fields
* fix: sider fix
diff --git a/erpnext/public/js/telephony.js b/erpnext/public/js/telephony.js
index 6cb1207..b66126c 100644
--- a/erpnext/public/js/telephony.js
+++ b/erpnext/public/js/telephony.js
@@ -1,13 +1,16 @@
frappe.ui.form.ControlData = frappe.ui.form.ControlData.extend( {
make_input() {
- this._super();
+ if (!this.df.read_only) {
+ this._super();
+ }
if (this.df.options == 'Phone') {
this.setup_phone();
}
},
setup_phone() {
if (frappe.phone_call.handler) {
- this.$wrapper.find('.control-input')
+ let control = this.df.read_only ? '.control-value' : '.control-input';
+ this.$wrapper.find(control)
.append(`
<span class="phone-btn">
<a class="btn-open no-decoration" title="${__('Make a call')}">