Skip to content

Commit

Permalink
fix: Salary component account filter (frappe#26605)
Browse files Browse the repository at this point in the history
* fix: salary component account filter

* fix: cleanup
  • Loading branch information
pateljannat authored Jul 27, 2021
1 parent cfd73ed commit aaea5ed
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions erpnext/payroll/doctype/salary_component/salary_component.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,18 @@
frappe.ui.form.on('Salary Component', {
setup: function(frm) {
frm.set_query("account", "accounts", function(doc, cdt, cdn) {
var d = locals[cdt][cdn];
let d = frappe.get_doc(cdt, cdn);

let root_type = "Liability";
if (frm.doc.type == "Deduction") {
root_type = "Expense";
}

return {
filters: {
"is_group": 0,
"company": d.company
"company": d.company,
"root_type": root_type
}
};
});
Expand Down

0 comments on commit aaea5ed

Please sign in to comment.