Merge pull request #34174 from Vishnu7025/coa-import-currency
fix: currency in coa import
This commit is contained in:
commit
81651beaef
@ -29,6 +29,7 @@ def create_charts(
|
|||||||
"root_type",
|
"root_type",
|
||||||
"is_group",
|
"is_group",
|
||||||
"tax_rate",
|
"tax_rate",
|
||||||
|
"account_currency",
|
||||||
]:
|
]:
|
||||||
|
|
||||||
account_number = cstr(child.get("account_number")).strip()
|
account_number = cstr(child.get("account_number")).strip()
|
||||||
@ -95,7 +96,17 @@ def identify_is_group(child):
|
|||||||
is_group = child.get("is_group")
|
is_group = child.get("is_group")
|
||||||
elif len(
|
elif len(
|
||||||
set(child.keys())
|
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
|
is_group = 1
|
||||||
else:
|
else:
|
||||||
@ -185,6 +196,7 @@ def get_account_tree_from_existing_company(existing_company):
|
|||||||
"root_type",
|
"root_type",
|
||||||
"tax_rate",
|
"tax_rate",
|
||||||
"account_number",
|
"account_number",
|
||||||
|
"account_currency",
|
||||||
],
|
],
|
||||||
order_by="lft, rgt",
|
order_by="lft, rgt",
|
||||||
)
|
)
|
||||||
@ -267,6 +279,7 @@ def build_tree_from_json(chart_template, chart_data=None, from_coa_importer=Fals
|
|||||||
"root_type",
|
"root_type",
|
||||||
"is_group",
|
"is_group",
|
||||||
"tax_rate",
|
"tax_rate",
|
||||||
|
"account_currency",
|
||||||
]:
|
]:
|
||||||
continue
|
continue
|
||||||
|
|
||||||
|
@ -36,7 +36,7 @@ def validate_columns(data):
|
|||||||
|
|
||||||
no_of_columns = max([len(d) for d in data])
|
no_of_columns = max([len(d) for d in data])
|
||||||
|
|
||||||
if no_of_columns > 7:
|
if no_of_columns > 8:
|
||||||
frappe.throw(
|
frappe.throw(
|
||||||
_("More columns found than expected. Please compare the uploaded file with standard template"),
|
_("More columns found than expected. Please compare the uploaded file with standard template"),
|
||||||
title=(_("Wrong Template")),
|
title=(_("Wrong Template")),
|
||||||
@ -233,6 +233,7 @@ def build_forest(data):
|
|||||||
is_group,
|
is_group,
|
||||||
account_type,
|
account_type,
|
||||||
root_type,
|
root_type,
|
||||||
|
account_currency,
|
||||||
) = i
|
) = i
|
||||||
|
|
||||||
if not account_name:
|
if not account_name:
|
||||||
@ -253,6 +254,8 @@ def build_forest(data):
|
|||||||
charts_map[account_name]["account_type"] = account_type
|
charts_map[account_name]["account_type"] = account_type
|
||||||
if root_type:
|
if root_type:
|
||||||
charts_map[account_name]["root_type"] = 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]
|
path = return_parent(data, account_name)[::-1]
|
||||||
paths.append(path) # List of path is created
|
paths.append(path) # List of path is created
|
||||||
line_no += 1
|
line_no += 1
|
||||||
@ -315,6 +318,7 @@ def get_template(template_type):
|
|||||||
"Is Group",
|
"Is Group",
|
||||||
"Account Type",
|
"Account Type",
|
||||||
"Root Type",
|
"Root Type",
|
||||||
|
"Account Currency",
|
||||||
]
|
]
|
||||||
writer = UnicodeWriter()
|
writer = UnicodeWriter()
|
||||||
writer.writerow(fields)
|
writer.writerow(fields)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user