Skip to content

Commit

Permalink
feat: add company filter to child table field
Browse files Browse the repository at this point in the history
(cherry picked from commit 5190907)
  • Loading branch information
GursheenK authored and mergify[bot] committed Mar 3, 2024
1 parent d130aad commit 0ede99b
Showing 1 changed file with 13 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
};
});
}
Expand Down

0 comments on commit 0ede99b

Please sign in to comment.