mirror of
https://github.com/frappe/erpnext.git
synced 2026-09-20 03:47:11 +00:00
fix: Rename bank account type doctypes (#21179)
* fix: Rename bank account type doctypes Co-authored-by: Saqib <nextchamp.saqib@gmail.com>
This commit is contained in:
@@ -67,11 +67,11 @@ def add_bank_accounts(response, bank, company):
|
||||
frappe.throw(_("Please setup a default bank account for company {0}").format(company))
|
||||
|
||||
for account in response["accounts"]:
|
||||
acc_type = frappe.db.get_value("Account Type", account["type"])
|
||||
acc_type = frappe.db.get_value("Bank Account Type", account["type"])
|
||||
if not acc_type:
|
||||
add_account_type(account["type"])
|
||||
|
||||
acc_subtype = frappe.db.get_value("Account Subtype", account["subtype"])
|
||||
acc_subtype = frappe.db.get_value("Bank Account Subtype", account["subtype"])
|
||||
if not acc_subtype:
|
||||
add_account_subtype(account["subtype"])
|
||||
|
||||
@@ -106,7 +106,7 @@ def add_bank_accounts(response, bank, company):
|
||||
def add_account_type(account_type):
|
||||
try:
|
||||
frappe.get_doc({
|
||||
"doctype": "Account Type",
|
||||
"doctype": "Bank Account Type",
|
||||
"account_type": account_type
|
||||
}).insert()
|
||||
except Exception:
|
||||
@@ -116,7 +116,7 @@ def add_account_type(account_type):
|
||||
def add_account_subtype(account_subtype):
|
||||
try:
|
||||
frappe.get_doc({
|
||||
"doctype": "Account Subtype",
|
||||
"doctype": "Bank Account Subtype",
|
||||
"account_subtype": account_subtype
|
||||
}).insert()
|
||||
except Exception:
|
||||
|
||||
@@ -23,11 +23,11 @@ class TestPlaidSettings(unittest.TestCase):
|
||||
for ba in frappe.get_all("Bank Account"):
|
||||
frappe.get_doc("Bank Account", ba.name).delete()
|
||||
|
||||
for at in frappe.get_all("Account Type"):
|
||||
frappe.get_doc("Account Type", at.name).delete()
|
||||
for at in frappe.get_all("Bank Account Type"):
|
||||
frappe.get_doc("Bank Account Type", at.name).delete()
|
||||
|
||||
for ast in frappe.get_all("Account Subtype"):
|
||||
frappe.get_doc("Account Subtype", ast.name).delete()
|
||||
for ast in frappe.get_all("Bank Account Subtype"):
|
||||
frappe.get_doc("Bank Account Subtype", ast.name).delete()
|
||||
|
||||
def test_plaid_disabled(self):
|
||||
frappe.db.set_value("Plaid Settings", None, "enabled", 0)
|
||||
@@ -35,11 +35,11 @@ class TestPlaidSettings(unittest.TestCase):
|
||||
|
||||
def test_add_account_type(self):
|
||||
add_account_type("brokerage")
|
||||
self.assertEqual(frappe.get_doc("Account Type", "brokerage").name, "brokerage")
|
||||
self.assertEqual(frappe.get_doc("Bank Account Type", "brokerage").name, "brokerage")
|
||||
|
||||
def test_add_account_subtype(self):
|
||||
add_account_subtype("loan")
|
||||
self.assertEqual(frappe.get_doc("Account Subtype", "loan").name, "loan")
|
||||
self.assertEqual(frappe.get_doc("Bank Account Subtype", "loan").name, "loan")
|
||||
|
||||
def test_default_bank_account(self):
|
||||
if not frappe.db.exists("Bank", "Citi"):
|
||||
|
||||
Reference in New Issue
Block a user