diff --git a/erpnext/accounts/doctype/cost_center_allocation/cost_center_allocation.js b/erpnext/accounts/doctype/cost_center_allocation/cost_center_allocation.js index ab0baab24a..0da90161f5 100644 --- a/erpnext/accounts/doctype/cost_center_allocation/cost_center_allocation.js +++ b/erpnext/accounts/doctype/cost_center_allocation/cost_center_allocation.js @@ -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 + } }; }); }