Merge pull request #16001 from jsukrut/staging-fixes
[FIX][#15018][PATIENT Relation should be unique]
This commit is contained in:
commit
21983b8432
@ -120,3 +120,16 @@ var btn_invoice_registration = function (frm) {
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
frappe.ui.form.on('Patient Relation', {
|
||||
patient_relation_add: function(frm){
|
||||
frm.fields_dict['patient_relation'].grid.get_field('patient').get_query = function(frm){
|
||||
var patient_list = [];
|
||||
if(!frm.doc.__islocal) patient_list.push(frm.doc.name);
|
||||
$.each(frm.doc.patient_relation, function(idx, val){
|
||||
if (val.patient) patient_list.push(val.patient);
|
||||
});
|
||||
return { filters: [['Patient', 'name', 'not in', patient_list]] };
|
||||
};
|
||||
}
|
||||
});
|
Loading…
x
Reference in New Issue
Block a user