From b1e68bd022f4ccd4860220a1a1fcb6fee90f1016 Mon Sep 17 00:00:00 2001 From: Deepesh Garg <42651287+deepeshgarg007@users.noreply.github.com> Date: Thu, 23 Apr 2020 12:19:30 +0530 Subject: [PATCH] fix: Rename bank account type doctypes (#21179) * fix: Rename bank account type doctypes Co-authored-by: Saqib --- .../account_subtype/account_subtype.json | 134 ------------------ .../account_subtype/test_account_subtype.js | 23 --- .../doctype/account_type/account_type.js | 8 -- .../doctype/account_type/account_type.json | 134 ------------------ .../doctype/account_type/test_account_type.py | 9 -- .../doctype/bank_account/bank_account.json | 6 +- .../__init__.py | 0 .../bank_account_subtype.js} | 2 +- .../bank_account_subtype.json | 134 ++++++++++++++++++ .../bank_account_subtype.py} | 2 +- .../test_bank_account_subtype.js} | 6 +- .../test_bank_account_subtype.py} | 2 +- .../__init__.py | 0 .../bank_account_type/bank_account_type.js | 8 ++ .../bank_account_type/bank_account_type.json | 68 +++++++++ .../bank_account_type.py} | 5 +- .../test_bank_account_type.py | 10 ++ .../doctype/plaid_settings/plaid_settings.py | 8 +- .../plaid_settings/test_plaid_settings.py | 12 +- erpnext/patches.txt | 1 + .../v12_0/rename_account_type_doctype.py | 7 + 21 files changed, 250 insertions(+), 329 deletions(-) delete mode 100644 erpnext/accounts/doctype/account_subtype/account_subtype.json delete mode 100644 erpnext/accounts/doctype/account_subtype/test_account_subtype.js delete mode 100644 erpnext/accounts/doctype/account_type/account_type.js delete mode 100644 erpnext/accounts/doctype/account_type/account_type.json delete mode 100644 erpnext/accounts/doctype/account_type/test_account_type.py rename erpnext/accounts/doctype/{account_subtype => bank_account_subtype}/__init__.py (100%) rename erpnext/accounts/doctype/{account_subtype/account_subtype.js => bank_account_subtype/bank_account_subtype.js} (77%) create mode 100644 erpnext/accounts/doctype/bank_account_subtype/bank_account_subtype.json rename erpnext/accounts/doctype/{account_type/account_type.py => bank_account_subtype/bank_account_subtype.py} (86%) rename erpnext/accounts/doctype/{account_type/test_account_type.js => bank_account_subtype/test_bank_account_subtype.js} (69%) rename erpnext/accounts/doctype/{account_subtype/test_account_subtype.py => bank_account_subtype/test_bank_account_subtype.py} (78%) rename erpnext/accounts/doctype/{account_type => bank_account_type}/__init__.py (100%) create mode 100644 erpnext/accounts/doctype/bank_account_type/bank_account_type.js create mode 100644 erpnext/accounts/doctype/bank_account_type/bank_account_type.json rename erpnext/accounts/doctype/{account_subtype/account_subtype.py => bank_account_type/bank_account_type.py} (60%) create mode 100644 erpnext/accounts/doctype/bank_account_type/test_bank_account_type.py create mode 100644 erpnext/patches/v12_0/rename_account_type_doctype.py diff --git a/erpnext/accounts/doctype/account_subtype/account_subtype.json b/erpnext/accounts/doctype/account_subtype/account_subtype.json deleted file mode 100644 index 6b1f2a2526e..00000000000 --- a/erpnext/accounts/doctype/account_subtype/account_subtype.json +++ /dev/null @@ -1,134 +0,0 @@ -{ - "allow_copy": 0, - "allow_events_in_timeline": 0, - "allow_guest_to_view": 0, - "allow_import": 1, - "allow_rename": 1, - "autoname": "field:account_subtype", - "beta": 0, - "creation": "2018-10-25 15:46:08.054586", - "custom": 0, - "docstatus": 0, - "doctype": "DocType", - "document_type": "", - "editable_grid": 1, - "engine": "InnoDB", - "fields": [ - { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fieldname": "account_subtype", - "fieldtype": "Data", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Account Subtype", - "length": 0, - "no_copy": 0, - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, - "unique": 1 - } - ], - "has_web_view": 0, - "hide_heading": 0, - "hide_toolbar": 0, - "idx": 0, - "image_view": 0, - "in_create": 0, - "is_submittable": 0, - "issingle": 0, - "istable": 0, - "max_attachments": 0, - "modified": "2018-10-25 15:47:03.841390", - "modified_by": "Administrator", - "module": "Accounts", - "name": "Account Subtype", - "name_case": "", - "owner": "Administrator", - "permissions": [ - { - "amend": 0, - "cancel": 0, - "create": 1, - "delete": 1, - "email": 1, - "export": 1, - "if_owner": 0, - "import": 0, - "permlevel": 0, - "print": 1, - "read": 1, - "report": 1, - "role": "System Manager", - "set_user_permissions": 0, - "share": 1, - "submit": 0, - "write": 1 - }, - { - "amend": 0, - "cancel": 0, - "create": 1, - "delete": 1, - "email": 1, - "export": 1, - "if_owner": 0, - "import": 0, - "permlevel": 0, - "print": 1, - "read": 1, - "report": 1, - "role": "Accounts Manager", - "set_user_permissions": 0, - "share": 1, - "submit": 0, - "write": 1 - }, - { - "amend": 0, - "cancel": 0, - "create": 1, - "delete": 1, - "email": 1, - "export": 1, - "if_owner": 0, - "import": 0, - "permlevel": 0, - "print": 1, - "read": 1, - "report": 1, - "role": "Accounts User", - "set_user_permissions": 0, - "share": 1, - "submit": 0, - "write": 1 - } - ], - "quick_entry": 1, - "read_only": 0, - "read_only_onload": 0, - "show_name_in_global_search": 0, - "sort_field": "modified", - "sort_order": "DESC", - "track_changes": 0, - "track_seen": 0, - "track_views": 0 -} \ No newline at end of file diff --git a/erpnext/accounts/doctype/account_subtype/test_account_subtype.js b/erpnext/accounts/doctype/account_subtype/test_account_subtype.js deleted file mode 100644 index 5646763bbd0..00000000000 --- a/erpnext/accounts/doctype/account_subtype/test_account_subtype.js +++ /dev/null @@ -1,23 +0,0 @@ -/* eslint-disable */ -// rename this file from _test_[name] to test_[name] to activate -// and remove above this line - -QUnit.test("test: Account Subtype", function (assert) { - let done = assert.async(); - - // number of asserts - assert.expect(1); - - frappe.run_serially([ - // insert a new Account Subtype - () => frappe.tests.make('Account Subtype', [ - // values to be set - {key: 'value'} - ]), - () => { - assert.equal(cur_frm.doc.key, 'value'); - }, - () => done() - ]); - -}); diff --git a/erpnext/accounts/doctype/account_type/account_type.js b/erpnext/accounts/doctype/account_type/account_type.js deleted file mode 100644 index 858b56c077a..00000000000 --- a/erpnext/accounts/doctype/account_type/account_type.js +++ /dev/null @@ -1,8 +0,0 @@ -// Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and contributors -// For license information, please see license.txt - -frappe.ui.form.on('Account Type', { - refresh: function() { - - } -}); diff --git a/erpnext/accounts/doctype/account_type/account_type.json b/erpnext/accounts/doctype/account_type/account_type.json deleted file mode 100644 index 6b8f724b408..00000000000 --- a/erpnext/accounts/doctype/account_type/account_type.json +++ /dev/null @@ -1,134 +0,0 @@ -{ - "allow_copy": 0, - "allow_events_in_timeline": 0, - "allow_guest_to_view": 0, - "allow_import": 1, - "allow_rename": 1, - "autoname": "field:account_type", - "beta": 0, - "creation": "2018-10-25 15:45:45.789963", - "custom": 0, - "docstatus": 0, - "doctype": "DocType", - "document_type": "", - "editable_grid": 1, - "engine": "InnoDB", - "fields": [ - { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fieldname": "account_type", - "fieldtype": "Data", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Account Type", - "length": 0, - "no_copy": 0, - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, - "unique": 1 - } - ], - "has_web_view": 0, - "hide_heading": 0, - "hide_toolbar": 0, - "idx": 0, - "image_view": 0, - "in_create": 0, - "is_submittable": 0, - "issingle": 0, - "istable": 0, - "max_attachments": 0, - "modified": "2018-10-25 15:46:51.042604", - "modified_by": "Administrator", - "module": "Accounts", - "name": "Account Type", - "name_case": "", - "owner": "Administrator", - "permissions": [ - { - "amend": 0, - "cancel": 0, - "create": 1, - "delete": 1, - "email": 1, - "export": 1, - "if_owner": 0, - "import": 0, - "permlevel": 0, - "print": 1, - "read": 1, - "report": 1, - "role": "System Manager", - "set_user_permissions": 0, - "share": 1, - "submit": 0, - "write": 1 - }, - { - "amend": 0, - "cancel": 0, - "create": 1, - "delete": 1, - "email": 1, - "export": 1, - "if_owner": 0, - "import": 0, - "permlevel": 0, - "print": 1, - "read": 1, - "report": 1, - "role": "Accounts Manager", - "set_user_permissions": 0, - "share": 1, - "submit": 0, - "write": 1 - }, - { - "amend": 0, - "cancel": 0, - "create": 1, - "delete": 1, - "email": 1, - "export": 1, - "if_owner": 0, - "import": 0, - "permlevel": 0, - "print": 1, - "read": 1, - "report": 1, - "role": "Accounts User", - "set_user_permissions": 0, - "share": 1, - "submit": 0, - "write": 1 - } - ], - "quick_entry": 1, - "read_only": 0, - "read_only_onload": 0, - "show_name_in_global_search": 0, - "sort_field": "modified", - "sort_order": "DESC", - "track_changes": 0, - "track_seen": 0, - "track_views": 0 -} \ No newline at end of file diff --git a/erpnext/accounts/doctype/account_type/test_account_type.py b/erpnext/accounts/doctype/account_type/test_account_type.py deleted file mode 100644 index 824c2f66ae3..00000000000 --- a/erpnext/accounts/doctype/account_type/test_account_type.py +++ /dev/null @@ -1,9 +0,0 @@ -# -*- coding: utf-8 -*- -# Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and Contributors -# See license.txt -from __future__ import unicode_literals - -import unittest - -class TestAccountType(unittest.TestCase): - pass diff --git a/erpnext/accounts/doctype/bank_account/bank_account.json b/erpnext/accounts/doctype/bank_account/bank_account.json index aa9c434db0b..65a0a5138cd 100644 --- a/erpnext/accounts/doctype/bank_account/bank_account.json +++ b/erpnext/accounts/doctype/bank_account/bank_account.json @@ -64,13 +64,13 @@ "fieldname": "account_type", "fieldtype": "Link", "label": "Account Type", - "options": "Account Type" + "options": "Bank Account Type" }, { "fieldname": "account_subtype", "fieldtype": "Link", "label": "Account Subtype", - "options": "Account Subtype" + "options": "Bank Account Subtype" }, { "fieldname": "column_break_7", @@ -200,7 +200,7 @@ } ], "links": [], - "modified": "2020-01-30 20:42:26.458316", + "modified": "2020-04-06 21:00:45.379804", "modified_by": "Administrator", "module": "Accounts", "name": "Bank Account", diff --git a/erpnext/accounts/doctype/account_subtype/__init__.py b/erpnext/accounts/doctype/bank_account_subtype/__init__.py similarity index 100% rename from erpnext/accounts/doctype/account_subtype/__init__.py rename to erpnext/accounts/doctype/bank_account_subtype/__init__.py diff --git a/erpnext/accounts/doctype/account_subtype/account_subtype.js b/erpnext/accounts/doctype/bank_account_subtype/bank_account_subtype.js similarity index 77% rename from erpnext/accounts/doctype/account_subtype/account_subtype.js rename to erpnext/accounts/doctype/bank_account_subtype/bank_account_subtype.js index 30144adeea6..f0456651c8f 100644 --- a/erpnext/accounts/doctype/account_subtype/account_subtype.js +++ b/erpnext/accounts/doctype/bank_account_subtype/bank_account_subtype.js @@ -1,7 +1,7 @@ // Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and contributors // For license information, please see license.txt -frappe.ui.form.on('Account Subtype', { +frappe.ui.form.on('Bank Account Subtype', { refresh: function() { } diff --git a/erpnext/accounts/doctype/bank_account_subtype/bank_account_subtype.json b/erpnext/accounts/doctype/bank_account_subtype/bank_account_subtype.json new file mode 100644 index 00000000000..f875db8ca19 --- /dev/null +++ b/erpnext/accounts/doctype/bank_account_subtype/bank_account_subtype.json @@ -0,0 +1,134 @@ +{ + "allow_copy": 0, + "allow_events_in_timeline": 0, + "allow_guest_to_view": 0, + "allow_import": 1, + "allow_rename": 1, + "autoname": "field:account_subtype", + "beta": 0, + "creation": "2018-10-25 15:46:08.054586", + "custom": 0, + "docstatus": 0, + "doctype": "DocType", + "document_type": "", + "editable_grid": 1, + "engine": "InnoDB", + "fields": [ + { + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "account_subtype", + "fieldtype": "Data", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Account Subtype", + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, + "unique": 1 + } + ], + "has_web_view": 0, + "hide_heading": 0, + "hide_toolbar": 0, + "idx": 0, + "image_view": 0, + "in_create": 0, + "is_submittable": 0, + "issingle": 0, + "istable": 0, + "max_attachments": 0, + "modified": "2018-10-25 15:47:03.841390", + "modified_by": "Administrator", + "module": "Accounts", + "name": "Bank Account Subtype", + "name_case": "", + "owner": "Administrator", + "permissions": [ + { + "amend": 0, + "cancel": 0, + "create": 1, + "delete": 1, + "email": 1, + "export": 1, + "if_owner": 0, + "import": 0, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 1, + "role": "System Manager", + "set_user_permissions": 0, + "share": 1, + "submit": 0, + "write": 1 + }, + { + "amend": 0, + "cancel": 0, + "create": 1, + "delete": 1, + "email": 1, + "export": 1, + "if_owner": 0, + "import": 0, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 1, + "role": "Accounts Manager", + "set_user_permissions": 0, + "share": 1, + "submit": 0, + "write": 1 + }, + { + "amend": 0, + "cancel": 0, + "create": 1, + "delete": 1, + "email": 1, + "export": 1, + "if_owner": 0, + "import": 0, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 1, + "role": "Accounts User", + "set_user_permissions": 0, + "share": 1, + "submit": 0, + "write": 1 + } + ], + "quick_entry": 1, + "read_only": 0, + "read_only_onload": 0, + "show_name_in_global_search": 0, + "sort_field": "modified", + "sort_order": "DESC", + "track_changes": 0, + "track_seen": 0, + "track_views": 0 +} \ No newline at end of file diff --git a/erpnext/accounts/doctype/account_type/account_type.py b/erpnext/accounts/doctype/bank_account_subtype/bank_account_subtype.py similarity index 86% rename from erpnext/accounts/doctype/account_type/account_type.py rename to erpnext/accounts/doctype/bank_account_subtype/bank_account_subtype.py index 3e6429318b0..ab52c4af77c 100644 --- a/erpnext/accounts/doctype/account_type/account_type.py +++ b/erpnext/accounts/doctype/bank_account_subtype/bank_account_subtype.py @@ -5,5 +5,5 @@ from __future__ import unicode_literals from frappe.model.document import Document -class AccountType(Document): +class BankAccountSubtype(Document): pass diff --git a/erpnext/accounts/doctype/account_type/test_account_type.js b/erpnext/accounts/doctype/bank_account_subtype/test_bank_account_subtype.js similarity index 69% rename from erpnext/accounts/doctype/account_type/test_account_type.js rename to erpnext/accounts/doctype/bank_account_subtype/test_bank_account_subtype.js index 76e434f4ab5..f59999845af 100644 --- a/erpnext/accounts/doctype/account_type/test_account_type.js +++ b/erpnext/accounts/doctype/bank_account_subtype/test_bank_account_subtype.js @@ -2,15 +2,15 @@ // rename this file from _test_[name] to test_[name] to activate // and remove above this line -QUnit.test("test: Account Type", function (assert) { +QUnit.test("test: Bank Account Subtype", function (assert) { let done = assert.async(); // number of asserts assert.expect(1); frappe.run_serially([ - // insert a new Account Type - () => frappe.tests.make('Account Type', [ + // insert a new Bank Account Subtype + () => frappe.tests.make('Bank Account Subtype', [ // values to be set {key: 'value'} ]), diff --git a/erpnext/accounts/doctype/account_subtype/test_account_subtype.py b/erpnext/accounts/doctype/bank_account_subtype/test_bank_account_subtype.py similarity index 78% rename from erpnext/accounts/doctype/account_subtype/test_account_subtype.py rename to erpnext/accounts/doctype/bank_account_subtype/test_bank_account_subtype.py index c37b5b9db7d..ca3addc979d 100644 --- a/erpnext/accounts/doctype/account_subtype/test_account_subtype.py +++ b/erpnext/accounts/doctype/bank_account_subtype/test_bank_account_subtype.py @@ -5,5 +5,5 @@ from __future__ import unicode_literals import unittest -class TestAccountSubtype(unittest.TestCase): +class TestBankAccountSubtype(unittest.TestCase): pass diff --git a/erpnext/accounts/doctype/account_type/__init__.py b/erpnext/accounts/doctype/bank_account_type/__init__.py similarity index 100% rename from erpnext/accounts/doctype/account_type/__init__.py rename to erpnext/accounts/doctype/bank_account_type/__init__.py diff --git a/erpnext/accounts/doctype/bank_account_type/bank_account_type.js b/erpnext/accounts/doctype/bank_account_type/bank_account_type.js new file mode 100644 index 00000000000..4cfabe3d1d1 --- /dev/null +++ b/erpnext/accounts/doctype/bank_account_type/bank_account_type.js @@ -0,0 +1,8 @@ +// Copyright (c) 2020, Frappe Technologies Pvt. Ltd. and contributors +// For license information, please see license.txt + +frappe.ui.form.on('Bank Account Type', { + // refresh: function(frm) { + + // } +}); diff --git a/erpnext/accounts/doctype/bank_account_type/bank_account_type.json b/erpnext/accounts/doctype/bank_account_type/bank_account_type.json new file mode 100644 index 00000000000..5a297cc2f9c --- /dev/null +++ b/erpnext/accounts/doctype/bank_account_type/bank_account_type.json @@ -0,0 +1,68 @@ +{ + "actions": [], + "allow_import": 1, + "allow_rename": 1, + "autoname": "field:account_type", + "creation": "2018-10-25 15:45:45.789963", + "doctype": "DocType", + "editable_grid": 1, + "engine": "InnoDB", + "field_order": [ + "account_type" + ], + "fields": [ + { + "fieldname": "account_type", + "fieldtype": "Data", + "label": "Account Type", + "unique": 1 + } + ], + "links": [], + "modified": "2020-04-10 21:13:09.137898", + "modified_by": "Administrator", + "module": "Accounts", + "name": "Bank Account Type", + "owner": "Administrator", + "permissions": [ + { + "create": 1, + "delete": 1, + "email": 1, + "export": 1, + "print": 1, + "read": 1, + "report": 1, + "role": "System Manager", + "share": 1, + "write": 1 + }, + { + "create": 1, + "delete": 1, + "email": 1, + "export": 1, + "print": 1, + "read": 1, + "report": 1, + "role": "Accounts Manager", + "share": 1, + "write": 1 + }, + { + "create": 1, + "delete": 1, + "email": 1, + "export": 1, + "print": 1, + "read": 1, + "report": 1, + "role": "Accounts User", + "share": 1, + "write": 1 + } + ], + "quick_entry": 1, + "sort_field": "modified", + "sort_order": "DESC" +} \ No newline at end of file diff --git a/erpnext/accounts/doctype/account_subtype/account_subtype.py b/erpnext/accounts/doctype/bank_account_type/bank_account_type.py similarity index 60% rename from erpnext/accounts/doctype/account_subtype/account_subtype.py rename to erpnext/accounts/doctype/bank_account_type/bank_account_type.py index 46c45cc733e..b7dc0e0dc37 100644 --- a/erpnext/accounts/doctype/account_subtype/account_subtype.py +++ b/erpnext/accounts/doctype/bank_account_type/bank_account_type.py @@ -1,9 +1,10 @@ # -*- coding: utf-8 -*- -# Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and contributors +# Copyright (c) 2020, Frappe Technologies Pvt. Ltd. and contributors # For license information, please see license.txt from __future__ import unicode_literals +# import frappe from frappe.model.document import Document -class AccountSubtype(Document): +class BankAccountType(Document): pass diff --git a/erpnext/accounts/doctype/bank_account_type/test_bank_account_type.py b/erpnext/accounts/doctype/bank_account_type/test_bank_account_type.py new file mode 100644 index 00000000000..f04725a2e55 --- /dev/null +++ b/erpnext/accounts/doctype/bank_account_type/test_bank_account_type.py @@ -0,0 +1,10 @@ +# -*- coding: utf-8 -*- +# Copyright (c) 2020, Frappe Technologies Pvt. Ltd. and Contributors +# See license.txt +from __future__ import unicode_literals + +# import frappe +import unittest + +class TestBankAccountType(unittest.TestCase): + pass diff --git a/erpnext/erpnext_integrations/doctype/plaid_settings/plaid_settings.py b/erpnext/erpnext_integrations/doctype/plaid_settings/plaid_settings.py index 7083950c56f..b4a5bd11a04 100644 --- a/erpnext/erpnext_integrations/doctype/plaid_settings/plaid_settings.py +++ b/erpnext/erpnext_integrations/doctype/plaid_settings/plaid_settings.py @@ -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: diff --git a/erpnext/erpnext_integrations/doctype/plaid_settings/test_plaid_settings.py b/erpnext/erpnext_integrations/doctype/plaid_settings/test_plaid_settings.py index 29e8fa4fec8..1a063d6b6f8 100644 --- a/erpnext/erpnext_integrations/doctype/plaid_settings/test_plaid_settings.py +++ b/erpnext/erpnext_integrations/doctype/plaid_settings/test_plaid_settings.py @@ -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"): diff --git a/erpnext/patches.txt b/erpnext/patches.txt index 8478c1020de..765f911bef4 100644 --- a/erpnext/patches.txt +++ b/erpnext/patches.txt @@ -662,6 +662,7 @@ erpnext.patches.v12_0.create_irs_1099_field_united_states erpnext.patches.v12_0.move_bank_account_swift_number_to_bank erpnext.patches.v12_0.rename_bank_reconciliation_fields # 2020-01-22 erpnext.patches.v12_0.set_received_qty_in_material_request_as_per_stock_uom +erpnext.patches.v12_0.rename_account_type_doctype erpnext.patches.v12_0.recalculate_requested_qty_in_bin erpnext.patches.v12_0.update_healthcare_refactored_changes erpnext.patches.v12_0.set_total_batch_quantity diff --git a/erpnext/patches/v12_0/rename_account_type_doctype.py b/erpnext/patches/v12_0/rename_account_type_doctype.py new file mode 100644 index 00000000000..ffb4e937b18 --- /dev/null +++ b/erpnext/patches/v12_0/rename_account_type_doctype.py @@ -0,0 +1,7 @@ +from __future__ import unicode_literals +import frappe + +def execute(): + frappe.rename_doc('DocType', 'Account Type', 'Bank Account Type', force=True) + frappe.rename_doc('DocType', 'Account Subtype', 'Bank Account Subtype', force=True) + frappe.reload_doc('accounts', 'doctype', 'bank_account') \ No newline at end of file