fix: Salary component account filter (#26604)

* fix: salary component account filter

* fix: cleanup
This commit is contained in:
Jannat Patel 2021-07-27 09:40:12 +05:30 committed by GitHub
parent 1b6c75bbb1
commit ae9d1d9617
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

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