Skip to content

Commit

Permalink
fix: practitioner gets cleared in book appointment dialog
Browse files Browse the repository at this point in the history
  • Loading branch information
akashkrishna619 committed Mar 2, 2023
1 parent 834bdbe commit 08f4076
Showing 1 changed file with 10 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -346,16 +346,20 @@ let check_and_set_availability = function(frm) {
'appointment_date': frm.doc.appointment_date
});

let selected_department = frm.doc.department;

d.fields_dict['department'].df.onchange = () => {
d.set_values({
'practitioner': ''
});
let department = d.get_value('department');
if (department) {
if (selected_department != d.get_value('department')) {
d.set_values({
'practitioner': ''
});
selected_department = d.get_value('department');
}
if (d.get_value('department')) {
d.fields_dict.practitioner.get_query = function() {
return {
filters: {
'department': department
'department': selected_department
}
};
};
Expand Down

0 comments on commit 08f4076

Please sign in to comment.