feat: add company filter to child table field

This commit is contained in:
Gursheen Anand 2024-03-03 18:08:23 +05:30
parent 6f5815e44f
commit 51909077bd

View File

@ -3,16 +3,21 @@
frappe.ui.form.on('Cost Center Allocation', {
setup: function(frm) {
let filters = {"is_group": 0};
if (frm.doc.company) {
$.extend(filters, {
"company": frm.doc.company
});
}
frm.set_query('main_cost_center', function() {
return {
filters: filters
filters: {
company: frm.doc.company,
is_group: 0
}
};
});
frm.set_query('cost_center', 'allocation_percentages', function() {
return {
filters: {
company: frm.doc.company,
is_group: 0
}
};
});
}