Merge pull request #40250 from GursheenK/company-filter-in-cost-center-allocation

fix(minor): company filter in cost center allocation
This commit is contained in:
Gursheen Kaur Anand 2024-03-03 18:13:48 +05:30 committed by GitHub
commit 031b99f373
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

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
}
};
});
}