How to Create Organization Hierarchy in ERPNEXT


I would like to know how to create Organization Hierarchy and Sub Ledgers for each Legal Entity
from Top Level to below

  1. Business Group (ABC)
    1.1 ----> Legal Entity (USA)
    1.1.1 ----> Department (HR) ----> Section (Recruitment) ----> Section (Payroll)
    1.1.2 ----> Department (FIN)
    1.2 ----> Legal Entity (AU)
    1.2.1 ----> Department (HR) ----> Section (Recruitment) ----> Section (Payroll)
    1.2.2 ----> Department (FIN)

    And Each Legal Entity has its own Chart of Accounts with its own Currency and all under One General Ledger for the Business Group


you can make it by creating tree or by creating doctypes and make relations by fields
it means ====> create doctype for Department then another on for Section and in section doctype make a link field of department
if you want to use this structure for example in employee doctype use function set_query

cur_frm.set_query("sections", function () {
		return {
			"filters": {
				"department": cur_frm.doc.department

Thanks very much

Department itself is a tree in Version 11