From 2e5a358e9617be8efe2a661008788aef0c2f7744 Mon Sep 17 00:00:00 2001 From: pateljannat Date: Fri, 23 Jul 2021 13:06:57 +0530 Subject: [PATCH] fix: salary component account filter --- erpnext/hr/doctype/salary_component/salary_component.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/erpnext/hr/doctype/salary_component/salary_component.js b/erpnext/hr/doctype/salary_component/salary_component.js index c455eb3303b..f2a0e2e715d 100644 --- a/erpnext/hr/doctype/salary_component/salary_component.js +++ b/erpnext/hr/doctype/salary_component/salary_component.js @@ -5,10 +5,17 @@ frappe.ui.form.on('Salary Component', { setup: function(frm) { frm.set_query("default_account", "accounts", function(doc, cdt, cdn) { var d = locals[cdt][cdn]; + + var 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 } }; });