Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
refactor: add filters to account_category query based on root_type
  • Loading branch information
Abdeali099 committed Mar 5, 2026
commit 7297e519b55906a254c845aa764a2ab5d0552718
10 changes: 10 additions & 0 deletions erpnext/accounts/doctype/account/account.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,16 @@ frappe.ui.form.on("Account", {
setup: function (frm) {
frm.add_fetch("parent_account", "report_type", "report_type");
frm.add_fetch("parent_account", "root_type", "root_type");

frm.set_query("account_category", function () {
if (!frm.doc.root_type) return;

return {
filters: {
root_type: ["in", [frm.doc.root_type, ""]],
},
};
});
},
onload: function (frm) {
frm.set_query("parent_account", function (doc) {
Expand Down