fix(telephony): Check if setup_phone method exists

We are just overriding Data control. 

This fails if other field type like "Small Text" has option set as "Phone"
This commit is contained in:
Suraj Shetty 2023-06-14 15:54:27 +05:30 committed by GitHub
parent 984f89d274
commit afaa85fbde
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -8,7 +8,7 @@ frappe.ui.form.ControlData = class ControlData extends frappe.ui.form.ControlDat
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.setup_phone && field.setup_phone();
field.has_icon = true;
}
});