Chart of account importer in V12

Hello guys,

I am having issue with importing chart of account into erpnext v12, I am getting this error message “Root Type for Assets must be one of the Asset, Liability, Income, Expense and Equity”. The following is the screenshot of the error I am getting, any help is welcomed!

Hello Heri, I can’t tell for sure from the screenshot that you provided, but maybe this will help… A completed Chart of Accounts (CoA) has a minimum set of Accounts. They have to have specific names and they have to have a specific Root Type or Account Type

As an example, You have to have an Asset that has an Account Type of “Capital Work in Progress”. Even if your business will never need it, that is a required Account.

My suggestion is to follow the Error message carefully and remedy whatever it tells you.

In the case above, I am guessing that you have an Account called Assets and you have not selected Asset as the Root Type. Edit that account and make the change.

(I have done a few of these and usually end up editing everything in the interface rather than trying to use the importer. It takes a long time but it works!)

1 Like

Thank you… I got it :slight_smile:

Hello.
I have a problems with COA importer my version is ERPNEXT 12 and I make a .json file for Ecuador Chart Account and the system recognizes the file but when try to set up the system indicates

AttributeError: ‘str’ object has no attribute ‘get’

I don’t think what happend because the .json file appears is ok.

Has anyone had this problem?

This is my .json file: Ecuador chart account

Posiblemente tendrás mas éxito con CSV (valores separados por commas):

Account Name,Parent Account,Account Number,Is Group,Account Type,Root Type
ACTIVOS,,1,1,,Asset
CORRIENTE,ACTIVOS,1.1,1,,Asset
EFECTIVO Y EQUIVALENTES DE EFECTIVO,CORRIENTE,1.1.1,1,,Asset
Caja Chica,EFECTIVO Y EQUIVALENTES DE EFECTIVO,1.1.1.01,0,Cash,Asset
Banco Bolivariano,EFECTIVO Y EQUIVALENTES DE EFECTIVO,1.1.1.05,0,Bank,Asset
CUENTAS Y DOCUMENTOS POR COBRAR,CORRIENTE,1.1.3,1,,Asset
CLIENTES,CUENTAS Y DOCUMENTOS POR COBRAR,1.1.3.01,1,,Asset
Cuentas Por Cobrar Clientes,CLIENTES,1.1.3.01.001,0,Receivable,Asset
OTRAS CUENTAS POR COBRAR,CUENTAS Y DOCUMENTOS POR COBRAR,1.1.3.02,1,,Asset
Accionistas,OTRAS CUENTAS POR COBRAR,1.1.3.02.001,0,,Asset
Empleados,OTRAS CUENTAS POR COBRAR,1.1.3.02.002,0,,Asset
Otros,OTRAS CUENTAS POR COBRAR,1.1.3.02.003,0,,Asset
INVENTARIOS,CORRIENTE,1.1.5,1,Stock,Asset
Materia Prima,INVENTARIOS,1.1.5.01,0,Stock,Asset
Produccion En Proceso,INVENTARIOS,1.1.5.02,0,Stock,Asset
Productos Terminados,INVENTARIOS,1.1.5.03,0,Stock,Asset
Suministros (Inventario),INVENTARIOS,1.1.5.04,0,Stock,Asset
Pre-Produccion,INVENTARIOS,1.1.5.05,0,Stock,Asset
ANTICIPOS,CORRIENTE,1.1.7,1,,Asset
ANTICIPO FISCO,ANTICIPOS,1.1.7.01,1,,Asset
Anticipo Impuesto Renta,ANTICIPO FISCO,1.1.7.01.001,0,Tax,Asset
Retencion Fuente Terceros,ANTICIPO FISCO,1.1.7.01.002,0,Tax,Asset
Retencion IVA Terceros,ANTICIPO FISCO,1.1.7.01.003,0,Tax,Asset
Credito Tributario IVA,ANTICIPO FISCO,1.1.7.01.004,0,Tax,Asset
PROVEEDORES,ANTICIPOS,1.1.7.02,1,,Asset
No Definido 1,PROVEEDORES,1.1.7.02.002,0,,Asset
"PROPIEDAD, PLANTA Y EQUIPO",ACTIVOS,1.2,1,,Asset
ACTIVOS FIJOS,"PROPIEDAD, PLANTA Y EQUIPO",1.2.1,1,,Asset
Obras En Proceso,ACTIVOS FIJOS,1.2.1.01,0,Fixed Asset,Asset
Equipo De Computacion,ACTIVOS FIJOS,1.2.1.02,0,Fixed Asset,Asset
Equipo De Oficina,ACTIVOS FIJOS,1.2.1.03,0,Fixed Asset,Asset
Equipo De Produccion,ACTIVOS FIJOS,1.2.1.04,0,Fixed Asset,Asset
Instalaciones,ACTIVOS FIJOS,1.2.1.05,0,Capital Work in Progress,Asset
DEPRECIACION ACUMULADA,"PROPIEDAD, PLANTA Y EQUIPO",1.2.2,1,,Asset
De Equipo De Computacion,DEPRECIACION ACUMULADA,1.2.2.01,0,,Asset
De Equipo De Oficina,DEPRECIACION ACUMULADA,1.2.2.02,0,,Asset
De Equipo De Produccion,DEPRECIACION ACUMULADA,1.2.2.03,0,,Asset
De Instalaciones,DEPRECIACION ACUMULADA,1.2.2.04,0,,Asset
Total Depreciacion Accumulada,DEPRECIACION ACUMULADA,1.2.2.10,0,Accumulated Depreciation,Asset
OTROS ACTIVOS,ACTIVOS,1.3,1,,Asset
ACTIVOS DIVERSOS,OTROS ACTIVOS,1.3.1,1,,Asset
Garantias,ACTIVOS DIVERSOS,1.3.1.01,0,,Asset
CUENTAS TEMPORALES,ACTIVOS,1.4,1,,Asset
Apertura Temporal,CUENTAS TEMPORALES,1.4.1,0,Temporary,Asset
PASIVOS,,2,1,,Liability
PASIVOS CORRIENTES,PASIVOS,2.1,1,,Liability
OBLIGACIONES BANCARIAS,PASIVOS CORRIENTES,2.1.1,1,,Liability
No Definido 2,OBLIGACIONES BANCARIAS,2.1.1.01,0,,Liability
No Definido 3,OBLIGACIONES BANCARIAS,2.1.1.02,0,,Liability
OBLIGACIONES CON PROVEEDORES,PASIVOS CORRIENTES,2.1.2,1,,Liability
No Definido 4,OBLIGACIONES CON PROVEEDORES,2.1.2.01,0,,Liability
Varios Proveedores,OBLIGACIONES CON PROVEEDORES,2.1.2.90,0,Payable,Liability
OBLIGACIONES CON EL FISCO,PASIVOS CORRIENTES,2.1.3,1,,Liability
Impuesto Renta Por Pagar,OBLIGACIONES CON EL FISCO,2.1.3.01,0,Tax,Liability
Impuesto IVA Por Pagar,OBLIGACIONES CON EL FISCO,2.1.3.02,0,Tax,Liability
Retenciones IVA Por Pagar,OBLIGACIONES CON EL FISCO,2.1.3.03,0,Tax,Liability
Retenciones Fuente Por Pagar,OBLIGACIONES CON EL FISCO,2.1.3.04,0,Tax,Liability
OBLIGACIONES CON EL IESS,PASIVOS CORRIENTES,2.1.4,1,,Liability
Aportes,OBLIGACIONES CON EL IESS,2.1.4.01,0,,Liability
Fondos Reserva,OBLIGACIONES CON EL IESS,2.1.4.02,0,,Liability
Prestamos,OBLIGACIONES CON EL IESS,2.1.4.03,0,,Liability
OBLIGACIONES CON EMPLEADOS,PASIVOS CORRIENTES,2.1.5,1,,Liability
Nominas Por Pagar,OBLIGACIONES CON EMPLEADOS,2.1.5.01,0,,Liability
Provision Decimo Tercer Sueldo,OBLIGACIONES CON EMPLEADOS,2.1.5.02,0,,Liability
Provision Decimo Cuarto Sueldo,OBLIGACIONES CON EMPLEADOS,2.1.5.03,0,,Liability
Utilidades 15% Por Pagar,OBLIGACIONES CON EMPLEADOS,2.1.5.04,0,,Liability
OBLIGACIONES CORRIENTES CON ACCIONISTAS,PASIVOS CORRIENTES,2.1.6,1,,Liability
Abdala Bucaram - Current,OBLIGACIONES CORRIENTES CON ACCIONISTAS,2.1.6.01,0,,Liability
OTRAS OBLIGACIONES,PASIVOS CORRIENTES,2.1.7,1,,Liability
Obligaciones Menores,OTRAS OBLIGACIONES,2.1.7.10,0,,Liability
INVENTARIOS POR PAGAR,PASIVOS CORRIENTES,2.1.8,1,,Liability
Inventario Entrante No Facturado,INVENTARIOS POR PAGAR,2.1.8.01,0,Stock Received But Not Billed,Liability
Activo Recibido Pero No Facturado,INVENTARIOS POR PAGAR,2.1.8.02,0,Asset Received But Not Billed,Liability
PASIVO NO CORRIENTE,PASIVOS,2.2,1,,Liability
OBLIGACIONES NO  CORRIENTES CON ACCIONISTAS,PASIVO NO CORRIENTE,2.2.2,1,,Liability
Abdala Bucaram - Future,OBLIGACIONES NO  CORRIENTES CON ACCIONISTAS,2.2.2.01,0,,Liability
PATRIMONIO,,3,1,,Equity
CAPITAL SOCIAL,PATRIMONIO,3.1,1,,Equity
"APORTACIONES,",CAPITAL SOCIAL,3.1.1,1,,Equity
Abdala Bucaram,"APORTACIONES,",3.1.1.01,0,Equity,Equity
No Definido 5,"APORTACIONES,",3.1.1.05,0,Equity,Equity
RESERVAS.,CAPITAL SOCIAL,3.1.2,1,,Equity
Reserva Legal,RESERVAS.,3.1.2.01,0,,Equity
Reserva Facultativa,RESERVAS.,3.1.2.02,0,,Equity
RESULTADOS,CAPITAL SOCIAL,3.1.3,1,,Equity
Utilidades Acumuladas,RESULTADOS,3.1.3.01,0,,Equity
Perdidas Acumuladas,RESULTADOS,3.1.3.02,0,,Equity
Resultados Ac Por Ad Niif,RESULTADOS,3.1.3.03,0,,Equity
Resultado Del Ejercicio,RESULTADOS,3.1.3.05,0,,Equity
INGRESOS,,4,1,,Income
VENTAS,INGRESOS,4.1,1,,Income
VENTAS LOCALES,VENTAS,4.1.1,1,,Income
Ventas Base 0%,VENTAS LOCALES,4.1.1.01,0,,Income
Ventas Base 12%,VENTAS LOCALES,4.1.1.02,0,,Income
OTROS INGRESOS,INGRESOS,4.2,1,,Income
INGRESOS DIVERSOS,OTROS INGRESOS,4.2.1,1,,Income
Utilidad En Venta De Activos,INGRESOS DIVERSOS,4.2.1.01,0,,Income
Ingresos Por Comisiones,INGRESOS DIVERSOS,4.2.1.02,0,,Income
Descuentos De Compras,INGRESOS DIVERSOS,4.2.1.03,0,,Income
Anticipos Contra Entregas Futuras,INGRESOS DIVERSOS,4.2.1.04,0,,Income
Otros Ingresos,INGRESOS DIVERSOS,4.2.1.10,0,,
COSTOS Y GASTOS,,5,1,,Expense
COSTOS,COSTOS Y GASTOS,5.1,1,,Expense
COSTOS DIRECTOS,COSTOS,5.1.1,1,,Expense
Materiales Directos,COSTOS DIRECTOS,5.1.1.01,0,,Expense
Mano De Obra Directa,COSTOS DIRECTOS,5.1.1.02,0,,Expense
Costos Sobre Ventas,COSTOS DIRECTOS,5.1.1.03,0,Cost of Goods Sold,Expense
Gastos Incluidos En La Valoración De Activos,COSTOS DIRECTOS,5.1.1.04,0,Expenses Included In Asset Valuation,Expense
Gastos De Valoracion,COSTOS DIRECTOS,5.1.1.05,0,Expenses Included In Valuation,Expense
Ajuste De Existencias,COSTOS DIRECTOS,5.1.1.06,0,Stock Adjustment,Expense
Descuentos De Ventas,COSTOS DIRECTOS,5.1.1.07,0,,Expense
COSTOS INDIRECTOS,COSTOS,5.1.2,1,,Expense
Materiales Indirectos,COSTOS INDIRECTOS,5.1.2.01,0,,Expense
Mano De Obra Indirecta,COSTOS INDIRECTOS,5.1.2.02,0,,Expense
COSTOS INDIRECTOS DISTINTOS,COSTOS INDIRECTOS,5.1.2.03,1,,Expense
Arriendos (C.I.),COSTOS INDIRECTOS DISTINTOS,5.1.2.03.001,0,,Expense
Agua (C.I.),COSTOS INDIRECTOS DISTINTOS,5.1.2.03.004,0,,Expense
Combustibles (C.I.),COSTOS INDIRECTOS DISTINTOS,5.1.2.03.005,0,,Expense
Depreciacion Activos (C.I.),COSTOS INDIRECTOS DISTINTOS,5.1.2.03.006,0,Depreciation,Expense
Energia Electrica (C.I.),COSTOS INDIRECTOS DISTINTOS,5.1.2.03.009,0,,Expense
Honorarios (C.I.),COSTOS INDIRECTOS DISTINTOS,5.1.2.03.010,0,,Expense
Mantenimiento Y Reparaciones (C.I.),COSTOS INDIRECTOS DISTINTOS,5.1.2.03.011,0,,Expense
Servicio Terceros (C.I.),COSTOS INDIRECTOS DISTINTOS,5.1.2.03.012,0,,Expense
Suministros (C.I.),COSTOS INDIRECTOS DISTINTOS,5.1.2.03.015,0,,Expense
"Telefono, Internet (C.I.)",COSTOS INDIRECTOS DISTINTOS,5.1.2.03.016,0,,Expense
Transportes (C.I.),COSTOS INDIRECTOS DISTINTOS,5.1.2.03.017,0,Chargeable,Expense
Varios (C.I.),COSTOS INDIRECTOS DISTINTOS,5.1.2.03.018,0,Chargeable,Expense
GASTOS,COSTOS Y GASTOS,5.2,1,,Expense
ADMINISTRATIVOS,GASTOS,5.2.1,1,,Expense
REMUNERACIONES,ADMINISTRATIVOS,5.2.1.01,1,,Expense
Sueldos,REMUNERACIONES,5.2.1.01.001,0,,Expense
Aporte Patronal,REMUNERACIONES,5.2.1.01.002,0,,Expense
"13, Y 14 Sueldos",REMUNERACIONES,5.2.1.01.003,0,,Expense
Fondos De Reserva,REMUNERACIONES,5.2.1.01.004,0,,Expense
Vacaciones,REMUNERACIONES,5.2.1.01.005,0,,Expense
Otros Beneficios,REMUNERACIONES,5.2.1.01.006,0,,Expense
OTROS GASTOS ADMINISTRATIVOS,ADMINISTRATIVOS,5.2.1.02,1,,Expense
Arriendos,OTROS GASTOS ADMINISTRATIVOS,5.2.1.02.001,0,,Expense
Agua Administrativo,OTROS GASTOS ADMINISTRATIVOS,5.2.1.02.002,0,,Expense
Combustibles Administrativos,OTROS GASTOS ADMINISTRATIVOS,5.2.1.02.003,0,,Expense
Redondeos,OTROS GASTOS ADMINISTRATIVOS,5.2.1.02.004,0,Round Off,Expense
Desajuste,OTROS GASTOS ADMINISTRATIVOS,5.2.1.02.005,0,,Expense
Depreciacion Activos Administrativos,OTROS GASTOS ADMINISTRATIVOS,5.2.1.02.006,0,Depreciation,Expense
Energia Electrica Administrativa,OTROS GASTOS ADMINISTRATIVOS,5.2.1.02.007,0,,Expense
Honorarios Administrativos,OTROS GASTOS ADMINISTRATIVOS,5.2.1.02.008,0,,Expense
Impuestos Y Contribuciones,OTROS GASTOS ADMINISTRATIVOS,5.2.1.02.009,0,,Expense
Mantenimiento Y Reparaciones,OTROS GASTOS ADMINISTRATIVOS,5.2.1.02.014,0,,Expense
Servicio Terceros,OTROS GASTOS ADMINISTRATIVOS,5.2.1.02.015,0,,Expense
Servicio Bancario,OTROS GASTOS ADMINISTRATIVOS,5.2.1.02.016,0,,Expense
Seguros,OTROS GASTOS ADMINISTRATIVOS,5.2.1.02.017,0,,Expense
Suministros Y Materiales,OTROS GASTOS ADMINISTRATIVOS,5.2.1.02.020,0,,Expense
"Telefono, Internet",OTROS GASTOS ADMINISTRATIVOS,5.2.1.02.021,0,,Expense
Transportes,OTROS GASTOS ADMINISTRATIVOS,5.2.1.02.022,0,,Expense
Varios Administrativos,OTROS GASTOS ADMINISTRATIVOS,5.2.1.02.023,0,,Expense
GASTO DE VENTAS,GASTOS,5.2.2,1,,Expense
Comisiones,GASTO DE VENTAS,5.2.2.01,0,,Expense
Gastos De Viaje,GASTO DE VENTAS,5.2.2.02,0,,Expense
Publicidad Y Promociones,GASTO DE VENTAS,5.2.2.03,0,,Expense
Varios,GASTO DE VENTAS,5.2.2.10,0,,Expense
Gastos Sobre Existencias,GASTOS,5.2.3,0,,Expense
OTROS GASTOS,GASTOS,5.2.4,1,,Expense
Gastos Financieros,OTROS GASTOS,5.2.4.01,0,,Expense
Desembolsos Por Costos Diferidos,OTROS GASTOS,5.2.4.02,0,,Expense
Gastos No Deducibles,OTROS GASTOS,5.2.4.04,0,,Expense
Gasto Impuestox Renta,OTROS GASTOS,5.2.4.10,0,,Expense

An alternate approach – use the REST API:

Upload the file to ERPNext:

curl --silent --location --request POST 'https://erp.hogarparatodos.com.ec/api/method/upload_file' \
--header 'Authorization: token {{Key}}:{{Secret}}' \
--header 'Accept: application/json' \
--form 'file=@"/home/lopez/erpnext/cosas/planDeCuentas.csv"' \
--form 'is_private="1"'

Run the chart of accounts installer:

curl --silent --location --request POST 'https://erp.hogarparatodos.com.ec/api/method/erpnext.accounts.doctype.chart_of_accounts_importer.chart_of_accounts_importer.import_coa' \
--header 'Authorization: token {{Key}}:{{Secret}}' \
--header 'Content-Type: application/json' \
--data-raw '{
    "file_name": "/private/files/planDeCuentas.csv",
    "company": "Hogar Para Todos"
}'