From 0ec747f57c374811ac34bfad1425dafd7217d53c Mon Sep 17 00:00:00 2001 From: Faris Ansari Date: Fri, 26 Jul 2019 08:15:45 +0530 Subject: [PATCH] fix(Account): Pass parent currency to child currency In a scenario where Parent Company Account's Currency is different from it's default currency, the Account Currency of Child would be set from the default currency of Company which might be wrong --- erpnext/accounts/doctype/account/account.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/erpnext/accounts/doctype/account/account.py b/erpnext/accounts/doctype/account/account.py index 68efe37719..0e57b3f198 100644 --- a/erpnext/accounts/doctype/account/account.py +++ b/erpnext/accounts/doctype/account/account.py @@ -123,7 +123,9 @@ class Account(NestedSet): doc.flags.ignore_root_company_validation = True doc.update({ "company": company, - "account_currency": None, + # parent account's currency should be passed down to child account's curreny + # if it is None, it picks it up from default company currency, which might be unintended + "account_currency": self.account_currency, "parent_account": parent_acc_name_map[company] }) doc.save()