fix: currency in coa import
diff --git a/erpnext/accounts/doctype/account/chart_of_accounts/chart_of_accounts.py b/erpnext/accounts/doctype/account/chart_of_accounts/chart_of_accounts.py
index 75f8f06..9e67c4c 100644
--- a/erpnext/accounts/doctype/account/chart_of_accounts/chart_of_accounts.py
+++ b/erpnext/accounts/doctype/account/chart_of_accounts/chart_of_accounts.py
@@ -29,6 +29,7 @@
"root_type",
"is_group",
"tax_rate",
+ "account_currency",
]:
account_number = cstr(child.get("account_number")).strip()
@@ -95,7 +96,17 @@
is_group = child.get("is_group")
elif len(
set(child.keys())
- - set(["account_name", "account_type", "root_type", "is_group", "tax_rate", "account_number"])
+ - set(
+ [
+ "account_name",
+ "account_type",
+ "root_type",
+ "is_group",
+ "tax_rate",
+ "account_number",
+ "account_currency",
+ ]
+ )
):
is_group = 1
else:
@@ -185,6 +196,7 @@
"root_type",
"tax_rate",
"account_number",
+ "account_currency",
],
order_by="lft, rgt",
)
@@ -267,6 +279,7 @@
"root_type",
"is_group",
"tax_rate",
+ "account_currency",
]:
continue
diff --git a/erpnext/accounts/doctype/chart_of_accounts_importer/chart_of_accounts_importer.py b/erpnext/accounts/doctype/chart_of_accounts_importer/chart_of_accounts_importer.py
index 220b747..dd2bd88 100644
--- a/erpnext/accounts/doctype/chart_of_accounts_importer/chart_of_accounts_importer.py
+++ b/erpnext/accounts/doctype/chart_of_accounts_importer/chart_of_accounts_importer.py
@@ -36,7 +36,7 @@
no_of_columns = max([len(d) for d in data])
- if no_of_columns > 7:
+ if no_of_columns > 8:
frappe.throw(
_("More columns found than expected. Please compare the uploaded file with standard template"),
title=(_("Wrong Template")),
@@ -233,6 +233,7 @@
is_group,
account_type,
root_type,
+ account_currency,
) = i
if not account_name:
@@ -253,6 +254,8 @@
charts_map[account_name]["account_type"] = account_type
if root_type:
charts_map[account_name]["root_type"] = root_type
+ if account_currency:
+ charts_map[account_name]["account_currency"] = account_currency
path = return_parent(data, account_name)[::-1]
paths.append(path) # List of path is created
line_no += 1
@@ -315,6 +318,7 @@
"Is Group",
"Account Type",
"Root Type",
+ "account_currency",
]
writer = UnicodeWriter()
writer.writerow(fields)