mirror of
https://github.com/frappe/erpnext.git
synced 2026-06-06 13:49:13 +00:00
fix(minor): fix dynamically changing grid properties
This commit is contained in:
@@ -39,11 +39,13 @@ frappe.ui.form.on('Patient Assessment', {
|
||||
},
|
||||
|
||||
set_score_range: function(frm) {
|
||||
let options = [];
|
||||
let options = [''];
|
||||
for(let i = frm.doc.scale_min; i <= frm.doc.scale_max; i++) {
|
||||
options.push(i);
|
||||
}
|
||||
frappe.meta.get_docfield('Patient Assessment Sheet', 'score', frm.doc.name).options = [''].concat(options);
|
||||
frm.fields_dict.assessment_sheet.grid.update_docfield_property(
|
||||
'score', 'options', options
|
||||
);
|
||||
},
|
||||
|
||||
calculate_total_score: function(frm, cdt, cdn) {
|
||||
@@ -83,4 +85,4 @@ frappe.ui.form.on('Patient Assessment Sheet', {
|
||||
score: function(frm, cdt, cdn) {
|
||||
frm.events.calculate_total_score(frm, cdt, cdn);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
@@ -58,8 +58,12 @@ frappe.ui.form.on('Therapy Plan', {
|
||||
}
|
||||
|
||||
if (frm.doc.therapy_plan_template) {
|
||||
frappe.meta.get_docfield('Therapy Plan Detail', 'therapy_type', frm.doc.name).read_only = 1;
|
||||
frappe.meta.get_docfield('Therapy Plan Detail', 'no_of_sessions', frm.doc.name).read_only = 1;
|
||||
frm.fields_dict.therapy_plan_details.grid.update_docfield_property(
|
||||
'therapy_type', 'read_only', 1,
|
||||
);
|
||||
frm.fields_dict.therapy_plan_details.grid.update_docfield_property(
|
||||
'no_of_sessions', 'read_only', 1
|
||||
);
|
||||
}
|
||||
},
|
||||
|
||||
@@ -126,4 +130,4 @@ frappe.ui.form.on('Therapy Plan Detail', {
|
||||
frm.set_value('total_sessions', total);
|
||||
refresh_field('total_sessions');
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user