ERP Next does not recognize my chart of account

Hi,

I’ve created an app for erpnext that loads a chart of account for Denmark.

Problem is, that ERPNext don’t see it when new companies are created.

It don’t show up in the dropdown.

I have been trying to find a git repo where someone is doing this, but without luck.

My code can be found here: GitHub - skovstedconsulting/frappe_test_1

I hope someone will take a look to see why it is not working.

Here is my folder tree:

├── README.md
├── license.txt
├── pyproject.toml
├── skovsted_app
│ ├── config
│ │ ├── init.py
│ ├── init.py
│ ├── accounts
│ │ ├── chart_of_accounts
│ │ │ ├── init.py
│ │ │ ├── dk_standard.py
│ ├── modules.txt
│ ├── pycache
│ │ ├── hooks.cpython-314.pyc
│ │ ├── init.cpython-314.pyc
│ ├── templates
│ │ ├── pages
│ │ │ ├── init.py
│ │ ├── init.py
│ ├── patches.txt
│ ├── skovsted_app
│ │ ├── init.py
│ │ ├── pycache
│ │ │ ├── init.cpython-314.pyc
│ │ ├── .frappe
│ ├── public
│ │ ├── .gitkeep
│ ├── hooks.py

The only thing i have changed is hooks.py where i have added these lines:

chart_of_accounts = {
“Denmark”: “skovsted_app.accounts.chart_of_accounts.dk_standard”
}

and I have added the folders accounts and chart_of_accounts

~/frappe-bench/apps/skovsted_app/skovsted_app/accounts/chart_of_accounts

inside chart_of_accounts I have created this file :

dk_standard.py

with this content:

def get_chart():

Built from your CSV.

Notes:

- Rows with Type = “Group sum” / “Sum from” are omitted (they’re reporting totals, not needed in CoA template).

- “Header” rows are represented as groups (is_group=1) to keep the hierarchy readable.

- Tax codes / allow payments / currency are not part of the standard chart template structure, so they’re ignored here.

return {
    "account_name": "Kontoplan - Billy",
    "is_group": 1,
    "children": [
        # -------------------------
        # PROFIT & LOSS
        # -------------------------
        {
            "account_name": "Indtægter",
            "account_number": "1100",
            "root_type": "Income",
            "is_group": 1,
            "children": [
                {"account_name": "Salg", "account_number": "1110", "root_type": "Income", "is_group": 0},
                {"account_name": "Workshop /Kursus", "account_number": "1111", "root_type": "Income", "is_group": 0},
                {"account_name": "Varesalg, MP", "account_number": "1112", "root_type": "Income", "is_group": 0},
                {"account_name": "Salg af fragt", "account_number": "1115", "root_type": "Income", "is_group": 0},
                {"account_name": "Salg til øvrig udland - varer", "account_number": "1120", "root_type": "Income", "is_group": 0},
                {"account_name": "Salg til øvrig udland - ydelser", "account_number": "1130", "root_type": "Income", "is_group": 0},
                {"account_name": "Salg til EU - varer", "account_number": "1140", "root_type": "Income", "is_group": 0},
                {"account_name": "Salg til EU - ydelser", "account_number": "1150", "root_type": "Income", "is_group": 0},
            ],
        },
        {
            "account_name": "Salgsomkostninger",
            "account_number": "1200",
            "root_type": "Expense",
            "is_group": 1,
            "children": [
                {"account_name": "Vareindkøb", "account_number": "1210", "root_type": "Expense", "is_group": 0},
                {"account_name": "Køb af varer - EU", "account_number": "1220", "root_type": "Expense", "is_group": 0},
                {"account_name": "Køb af ydelser - EU", "account_number": "1230", "root_type": "Expense", "is_group": 0},
                {"account_name": "Køb af varer - øvrig udland", "account_number": "1240", "root_type": "Expense", "is_group": 0},
                {"account_name": "Køb af ydelser - øvrig udland", "account_number": "1250", "root_type": "Expense", "is_group": 0},
                {"account_name": "Regulering af varelager", "account_number": "1260", "root_type": "Expense", "is_group": 0},
                {"account_name": "Andre direkte omkostninger", "account_number": "1270", "root_type": "Expense", "is_group": 0},
                {"account_name": "Kassedifferencer", "account_number": "1280", "root_type": "Expense", "is_group": 0},
                {"account_name": "Told", "account_number": "1290", "root_type": "Expense", "is_group": 0},
            ],
        },
        {
            "account_name": "Lønomkostninger",
            "account_number": "1400",
            "root_type": "Expense",
            "is_group": 1,
            "children": [
                {"account_name": "AM-indkomst", "account_number": "1410", "root_type": "Expense", "is_group": 0},
                {"account_name": "ATP-bidrag", "account_number": "1420", "root_type": "Expense", "is_group": 0},
                {"account_name": "Personalegoder", "account_number": "1430", "root_type": "Expense", "is_group": 0},
                {"account_name": "Personalepleje", "account_number": "1440", "root_type": "Expense", "is_group": 0},
                {"account_name": "Pension", "account_number": "1450", "root_type": "Expense", "is_group": 0},
                {"account_name": "Fradrag", "account_number": "1460", "root_type": "Expense", "is_group": 0},
                {"account_name": "Sociale omkostninger", "account_number": "1470", "root_type": "Expense", "is_group": 0},
                {"account_name": "Tillæg", "account_number": "1480", "root_type": "Expense", "is_group": 0},
                {"account_name": "B-honorar", "account_number": "1485", "root_type": "Expense", "is_group": 0},
                {"account_name": "Feriepenge", "account_number": "1490", "root_type": "Expense", "is_group": 0},
            ],
        },
        {
            "account_name": "Lokaleomkostninger",
            "account_number": "1500",
            "root_type": "Expense",
            "is_group": 1,
            "children": [
                {"account_name": "Husleje med moms", "account_number": "1510", "root_type": "Expense", "is_group": 0},
                {"account_name": "Husleje uden moms", "account_number": "1520", "root_type": "Expense", "is_group": 0},
                {"account_name": "El, vand og varme", "account_number": "1530", "root_type": "Expense", "is_group": 0},
                {"account_name": "Vedligeholdelse og rengøring", "account_number": "1540", "root_type": "Expense", "is_group": 0},
                {"account_name": "Forsikringer (lokale)", "account_number": "1550", "root_type": "Expense", "is_group": 0},
            ],
        },
        {
            "account_name": "Marketing- og rejseomkostninger",
            "account_number": "1600",
            "root_type": "Expense",
            "is_group": 1,
            "children": [
                {"account_name": "Fragt udgifter", "account_number": "1610", "root_type": "Expense", "is_group": 0},
                {"account_name": "Transport og rejser", "account_number": "1620", "root_type": "Expense", "is_group": 0},
                {"account_name": "Reklamer og markedsføring", "account_number": "1630", "root_type": "Expense", "is_group": 0},
                {"account_name": "Hotel", "account_number": "1640", "root_type": "Expense", "is_group": 0},
                {"account_name": "Repræsentation", "account_number": "1650", "root_type": "Expense", "is_group": 0},
                {"account_name": "Restaurant", "account_number": "1660", "root_type": "Expense", "is_group": 0},
            ],
        },
        {
            "account_name": "Bilomkostninger",
            "account_number": "1700",
            "root_type": "Expense",
            "is_group": 1,
            "children": [
                {"account_name": "Brændstof", "account_number": "1710", "root_type": "Expense", "is_group": 0},
                {"account_name": "Vedligeholdelse", "account_number": "1720", "root_type": "Expense", "is_group": 0},
                {"account_name": "Parkering", "account_number": "1730", "root_type": "Expense", "is_group": 0},
                {"account_name": "Bilforsikring", "account_number": "1740", "root_type": "Expense", "is_group": 0},
                {"account_name": "Vægtafgift", "account_number": "1750", "root_type": "Expense", "is_group": 0},
            ],
        },
        {
            "account_name": "Administrationsomkostninger",
            "account_number": "1800",
            "root_type": "Expense",
            "is_group": 1,
            "children": [
                {"account_name": "Kontorartikler", "account_number": "1810", "root_type": "Expense", "is_group": 0},
                {"account_name": "Abonnementer", "account_number": "1815", "root_type": "Expense", "is_group": 0},
                {"account_name": "Website", "account_number": "1820", "root_type": "Expense", "is_group": 0},
                {"account_name": "Regnskabsprogram", "account_number": "1825", "root_type": "Expense", "is_group": 0},
                {"account_name": "Telefon og internet", "account_number": "1830", "root_type": "Expense", "is_group": 0},
                {"account_name": "Små anskaffelser", "account_number": "1840", "root_type": "Expense", "is_group": 0},
                {"account_name": "Kørselsgodtgørelse", "account_number": "1850", "root_type": "Expense", "is_group": 0},
                {"account_name": "Konsulenter og freelancere", "account_number": "1860", "root_type": "Expense", "is_group": 0},
                {"account_name": "Gebyr Shipmondo og MobilPay", "account_number": "1865", "root_type": "Expense", "is_group": 0},
                {"account_name": "Forsikring", "account_number": "1870", "root_type": "Expense", "is_group": 0},
                {"account_name": "Inventar", "account_number": "1880", "root_type": "Expense", "is_group": 0},
                {"account_name": "Tab på kunder", "account_number": "1890", "root_type": "Expense", "is_group": 0},
                {"account_name": "Ej fradragsberettigede omkostninger", "account_number": "1895", "root_type": "Expense", "is_group": 0},
            ],
        },
        {
            "account_name": "Afskrivninger",
            "account_number": "2000",
            "root_type": "Expense",
            "is_group": 1,
            "children": [
                {"account_name": "Afskrivninger", "account_number": "2010", "root_type": "Expense", "is_group": 0},
            ],
        },
        {
            "account_name": "Finansielle indtægter",
            "account_number": "2200",
            "root_type": "Income",
            "is_group": 1,
            "children": [
                {"account_name": "Realiserede kursgevinster og -tab", "account_number": "2210", "root_type": "Income", "is_group": 0},
                {"account_name": "Rykkergebyrer", "account_number": "2220", "root_type": "Income", "is_group": 0},
                {"account_name": "Renteindtægter", "account_number": "2230", "root_type": "Income", "is_group": 0},
                {"account_name": "Gebyr indtægter", "account_number": "2240", "root_type": "Income", "is_group": 0},
            ],
        },
        {
            "account_name": "Finansielle udgifter",
            "account_number": "2300",
            "root_type": "Expense",
            "is_group": 1,
            "children": [
                {"account_name": "Renteudgifter", "account_number": "2310", "root_type": "Expense", "is_group": 0},
                {"account_name": "Gebyrer", "account_number": "2320", "root_type": "Expense", "is_group": 0},
            ],
        },
        {
            "account_name": "Skat af årets resultat",
            "account_number": "2500",
            "root_type": "Expense",
            "is_group": 1,
            "children": [
                {"account_name": "Skat", "account_number": "2510", "root_type": "Expense", "is_group": 0},
            ],
        },

        # -------------------------
        # BALANCE SHEET
        # -------------------------
        {
            "account_name": "Aktiver",
            "account_number": "5000",
            "root_type": "Asset",
            "is_group": 1,
            "children": [
                {
                    "account_name": "Anlægsaktiver",
                    "account_number": "5100",
                    "root_type": "Asset",
                    "is_group": 1,
                    "children": [
                        {
                            "account_name": "Immaterielle anlægsaktiver",
                            "account_number": "5200",
                            "root_type": "Asset",
                            "is_group": 1,
                            "children": [
                                {"account_name": "Immaterielle anlægsaktiver", "account_number": "5210", "root_type": "Asset", "is_group": 0},
                            ],
                        },
                        {
                            "account_name": "Materielle anlægsaktiver",
                            "account_number": "5300",
                            "root_type": "Asset",
                            "is_group": 1,
                            "children": [
                                {"account_name": "Driftmidler og inventar (kostpris)", "account_number": "5310", "root_type": "Asset", "is_group": 0},
                                {"account_name": "Driftmidler og inventar, akkumulerede afskrivninger", "account_number": "5320", "root_type": "Asset", "is_group": 0},
                            ],
                        },
                        {
                            "account_name": "Finansielle anlægsaktiver",
                            "account_number": "5400",
                            "root_type": "Asset",
                            "is_group": 1,
                            "children": [
                                {"account_name": "Kapitalandele af tilknyttede virksomheder", "account_number": "5410", "root_type": "Asset", "is_group": 0},
                                {"account_name": "Kapitalandele af associerede virksomheder", "account_number": "5420", "root_type": "Asset", "is_group": 0},
                                {"account_name": "Andre værdipapirer og kapitalandele", "account_number": "5430", "root_type": "Asset", "is_group": 0},
                                {"account_name": "Deposita", "account_number": "5440", "root_type": "Asset", "is_group": 0},
                            ],
                        },
                    ],
                },
                {
                    "account_name": "Omsætningsaktiver",
                    "account_number": "5600",
                    "root_type": "Asset",
                    "is_group": 1,
                    "children": [
                        {
                            "account_name": "Bank- og kontantbeholdninger",
                            "account_number": "5700",
                            "root_type": "Asset",
                            "is_group": 1,
                            "children": [
                                {"account_name": "kontanter", "account_number": "5701", "root_type": "Asset", "is_group": 0},
                                {"account_name": "Bank1", "account_number": "5710", "root_type": "Asset", "is_group": 0},
                                {"account_name": "Kontantbeholdning (ikke ibrug)", "account_number": "5720", "root_type": "Asset", "is_group": 0},
                            ],
                        },
                        {
                            "account_name": "Omsætningsaktiver",
                            "account_number": "5800",
                            "root_type": "Asset",
                            "is_group": 1,
                            "children": [
                                {"account_name": "Bank2", "account_number": "5802", "root_type": "Asset", "is_group": 0},
                                {"account_name": "Til gode hos kunder", "account_number": "5810", "root_type": "Asset", "is_group": 0},
                                {"account_name": "Til gode hos leverandører", "account_number": "5820", "root_type": "Asset", "is_group": 0},
                                {"account_name": "Mobilepay", "account_number": "5824", "root_type": "Asset", "is_group": 0},
                                {"account_name": "Shipmondo", "account_number": "5825", "root_type": "Asset", "is_group": 0},
                                {"account_name": "Varelager", "account_number": "5830", "root_type": "Asset", "is_group": 0},
                                {"account_name": "Pureste mudder", "account_number": "5840", "root_type": "Asset", "is_group": 0},
                            ],
                        },
                    ],
                },
            ],
        },
        {
            "account_name": "Passiver",
            "account_number": "7000",
            "root_type": "Liability",
            "is_group": 1,
            "children": [
                {
                    "account_name": "Egenkapital",
                    "account_number": "7100",
                    "root_type": "Equity",
                    "is_group": 1,
                    "children": [
                        {"account_name": "Dette års resultat", "account_number": "7110", "root_type": "Equity", "is_group": 0},
                        {"account_name": "Overført resultat", "account_number": "7120", "root_type": "Equity", "is_group": 0},
                        {"account_name": "Mellemregning med ejer", "account_number": "7130", "root_type": "Equity", "is_group": 0},
                        {"account_name": "Indskudt kapital", "account_number": "7140", "root_type": "Equity", "is_group": 0},
                        {"account_name": "Urealiserede kursgevinster og -tab", "account_number": "7150", "root_type": "Equity", "is_group": 0},
                    ],
                },
                {
                    "account_name": "Skyldig moms",
                    "account_number": "7200",
                    "root_type": "Liability",
                    "is_group": 1,
                    "children": [
                        {"account_name": "Afregnet moms", "account_number": "7210", "root_type": "Liability", "is_group": 0},
                        {"account_name": "Købsmoms (indgående moms)", "account_number": "7220", "root_type": "Liability", "is_group": 0},
                        {"account_name": "Moms af varer købt i udlandet", "account_number": "7230", "root_type": "Liability", "is_group": 0},
                        {"account_name": "Moms af ydelser købt i udlandet", "account_number": "7240", "root_type": "Liability", "is_group": 0},
                        {"account_name": "Salgsmoms (udgående moms)", "account_number": "7250", "root_type": "Liability", "is_group": 0},
                    ],
                },
                {
                    "account_name": "Kortfristede forpligtelser",
                    "account_number": "7300",
                    "root_type": "Liability",
                    "is_group": 1,
                    "children": [
                        {"account_name": "Skyldnere til kunder", "account_number": "7310", "root_type": "Liability", "is_group": 0},
                        {"account_name": "Skyldnere til leverandører", "account_number": "7320", "root_type": "Liability", "is_group": 0},
                        {"account_name": "Skyldig A-skat", "account_number": "7330", "root_type": "Liability", "is_group": 0},
                        {"account_name": "Skyldig AM-bidrag", "account_number": "7340", "root_type": "Liability", "is_group": 0},
                        {"account_name": "Skyldig ATP", "account_number": "7350", "root_type": "Liability", "is_group": 0},
                        {"account_name": "Hensatte forpligtelser", "account_number": "7360", "root_type": "Liability", "is_group": 0},
                        {"account_name": "Skyldig pension", "account_number": "7370", "root_type": "Liability", "is_group": 0},
                        {"account_name": "Skyldig skattekonto", "account_number": "7375", "root_type": "Liability", "is_group": 0},
                        {"account_name": "Skyldige feriepenge", "account_number": "7380", "root_type": "Liability", "is_group": 0},
                        {"account_name": "Skyldig selskabsskat", "account_number": "7385", "root_type": "Liability", "is_group": 0},
                        {"account_name": "Skyldige sociale omkostninger", "account_number": "7390", "root_type": "Liability", "is_group": 0},
                        {"account_name": "Gavekort", "account_number": "7395", "root_type": "Liability", "is_group": 0},
                    ],
                },
                {
                    "account_name": "Langfristede forpligtelser",
                    "account_number": "7400",
                    "root_type": "Liability",
                    "is_group": 1,
                    "children": [
                        {"account_name": "Banklån", "account_number": "7410", "root_type": "Liability", "is_group": 0},
                    ],
                },
            ],
        },
    ],
}