From b2a84fe478ff811662221d438ace338431286a63 Mon Sep 17 00:00:00 2001 From: Saqib Ansari Date: Mon, 6 Apr 2020 16:32:33 +0530 Subject: [PATCH 01/12] chore: rename bank reconciliation to bank clearance --- .../accounting_period/accounting_period.py | 2 +- .../README.md | 0 .../doctype/bank_clearance/__init__.py | 0 .../bank_clearance.js} | 2 +- .../bank_clearance/bank_clearance.json | 130 +++++ .../bank_clearance.py} | 2 +- .../bank_clearance/test_bank_clearance.py | 10 + .../doctype/bank_clearance_detail/README.md | 1 + .../__init__.py | 0 .../bank_clearance_detail.json} | 2 +- .../bank_clearance_detail.py} | 2 +- .../bank_reconciliation.json | 484 ------------------ .../test_bank_reconciliation.js | 22 - .../test_bank_reconciliation.py | 8 - .../bank_reconciliation_detail/README.md | 1 - .../bank_reconciliation_detail/__init__.py | 1 - erpnext/config/accounts.py | 4 +- .../v12_0/rename_bank_reconciliation.py | 14 + .../rename_bank_reconciliation_fields.py | 6 +- 19 files changed, 165 insertions(+), 526 deletions(-) rename erpnext/accounts/doctype/{bank_reconciliation => bank_clearance}/README.md (100%) create mode 100644 erpnext/accounts/doctype/bank_clearance/__init__.py rename erpnext/accounts/doctype/{bank_reconciliation/bank_reconciliation.js => bank_clearance/bank_clearance.js} (97%) create mode 100644 erpnext/accounts/doctype/bank_clearance/bank_clearance.json rename erpnext/accounts/doctype/{bank_reconciliation/bank_reconciliation.py => bank_clearance/bank_clearance.py} (99%) create mode 100644 erpnext/accounts/doctype/bank_clearance/test_bank_clearance.py create mode 100644 erpnext/accounts/doctype/bank_clearance_detail/README.md rename erpnext/accounts/doctype/{bank_reconciliation => bank_clearance_detail}/__init__.py (100%) rename erpnext/accounts/doctype/{bank_reconciliation_detail/bank_reconciliation_detail.json => bank_clearance_detail/bank_clearance_detail.json} (99%) rename erpnext/accounts/doctype/{bank_reconciliation_detail/bank_reconciliation_detail.py => bank_clearance_detail/bank_clearance_detail.py} (84%) delete mode 100644 erpnext/accounts/doctype/bank_reconciliation/bank_reconciliation.json delete mode 100644 erpnext/accounts/doctype/bank_reconciliation/test_bank_reconciliation.js delete mode 100644 erpnext/accounts/doctype/bank_reconciliation/test_bank_reconciliation.py delete mode 100644 erpnext/accounts/doctype/bank_reconciliation_detail/README.md delete mode 100644 erpnext/accounts/doctype/bank_reconciliation_detail/__init__.py create mode 100644 erpnext/patches/v12_0/rename_bank_reconciliation.py diff --git a/erpnext/accounts/doctype/accounting_period/accounting_period.py b/erpnext/accounts/doctype/accounting_period/accounting_period.py index f48d6dfc95..df6cedd7cf 100644 --- a/erpnext/accounts/doctype/accounting_period/accounting_period.py +++ b/erpnext/accounts/doctype/accounting_period/accounting_period.py @@ -42,7 +42,7 @@ class AccountingPeriod(Document): def get_doctypes_for_closing(self): docs_for_closing = [] doctypes = ["Sales Invoice", "Purchase Invoice", "Journal Entry", "Payroll Entry", \ - "Bank Reconciliation", "Asset", "Stock Entry"] + "Bank Clearance", "Asset", "Stock Entry"] closed_doctypes = [{"document_type": doctype, "closed": 1} for doctype in doctypes] for closed_doctype in closed_doctypes: docs_for_closing.append(closed_doctype) diff --git a/erpnext/accounts/doctype/bank_reconciliation/README.md b/erpnext/accounts/doctype/bank_clearance/README.md similarity index 100% rename from erpnext/accounts/doctype/bank_reconciliation/README.md rename to erpnext/accounts/doctype/bank_clearance/README.md diff --git a/erpnext/accounts/doctype/bank_clearance/__init__.py b/erpnext/accounts/doctype/bank_clearance/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/erpnext/accounts/doctype/bank_reconciliation/bank_reconciliation.js b/erpnext/accounts/doctype/bank_clearance/bank_clearance.js similarity index 97% rename from erpnext/accounts/doctype/bank_reconciliation/bank_reconciliation.js rename to erpnext/accounts/doctype/bank_clearance/bank_clearance.js index 19fadbf6de..ba3f2face6 100644 --- a/erpnext/accounts/doctype/bank_reconciliation/bank_reconciliation.js +++ b/erpnext/accounts/doctype/bank_clearance/bank_clearance.js @@ -1,7 +1,7 @@ // Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors // License: GNU General Public License v3. See license.txt -frappe.ui.form.on("Bank Reconciliation", { +frappe.ui.form.on("Bank Clearance", { setup: function(frm) { frm.add_fetch("account", "account_currency", "account_currency"); }, diff --git a/erpnext/accounts/doctype/bank_clearance/bank_clearance.json b/erpnext/accounts/doctype/bank_clearance/bank_clearance.json new file mode 100644 index 0000000000..a436d1effb --- /dev/null +++ b/erpnext/accounts/doctype/bank_clearance/bank_clearance.json @@ -0,0 +1,130 @@ +{ + "allow_copy": 1, + "creation": "2013-01-10 16:34:05", + "doctype": "DocType", + "document_type": "Document", + "engine": "InnoDB", + "field_order": [ + "account", + "account_currency", + "from_date", + "to_date", + "column_break_5", + "bank_account", + "include_reconciled_entries", + "include_pos_transactions", + "get_payment_entries", + "section_break_10", + "payment_entries", + "update_clearance_date", + "total_amount" + ], + "fields": [ + { + "fetch_from": "bank_account.account", + "fetch_if_empty": 1, + "fieldname": "account", + "fieldtype": "Link", + "in_list_view": 1, + "label": "Account", + "options": "Account", + "reqd": 1 + }, + { + "fieldname": "account_currency", + "fieldtype": "Link", + "hidden": 1, + "label": "Account Currency", + "options": "Currency", + "print_hide": 1 + }, + { + "fieldname": "from_date", + "fieldtype": "Date", + "in_list_view": 1, + "label": "From Date", + "reqd": 1 + }, + { + "fieldname": "to_date", + "fieldtype": "Date", + "in_list_view": 1, + "label": "To Date", + "reqd": 1 + }, + { + "fieldname": "column_break_5", + "fieldtype": "Column Break" + }, + { + "description": "Select the Bank Account to reconcile.", + "fieldname": "bank_account", + "fieldtype": "Link", + "label": "Bank Account", + "options": "Bank Account" + }, + { + "default": "0", + "fieldname": "include_reconciled_entries", + "fieldtype": "Check", + "in_list_view": 1, + "label": "Include Reconciled Entries" + }, + { + "default": "0", + "fieldname": "include_pos_transactions", + "fieldtype": "Check", + "label": "Include POS Transactions" + }, + { + "fieldname": "get_payment_entries", + "fieldtype": "Button", + "label": "Get Payment Entries" + }, + { + "fieldname": "section_break_10", + "fieldtype": "Section Break" + }, + { + "allow_bulk_edit": 1, + "fieldname": "payment_entries", + "fieldtype": "Table", + "label": "Payment Entries", + "options": "Bank Clearance Detail" + }, + { + "fieldname": "update_clearance_date", + "fieldtype": "Button", + "label": "Update Clearance Date" + }, + { + "fieldname": "total_amount", + "fieldtype": "Currency", + "label": "Total Amount", + "options": "account_currency", + "read_only": 1 + } + ], + "hide_toolbar": 1, + "icon": "fa fa-check", + "idx": 1, + "issingle": 1, + "modified": "2020-04-06 16:12:06.628008", + "modified_by": "Administrator", + "module": "Accounts", + "name": "Bank Clearance", + "owner": "Administrator", + "permissions": [ + { + "create": 1, + "read": 1, + "role": "Accounts User", + "share": 1, + "write": 1 + } + ], + "quick_entry": 1, + "read_only": 1, + "sort_field": "modified", + "sort_order": "ASC" +} \ No newline at end of file diff --git a/erpnext/accounts/doctype/bank_reconciliation/bank_reconciliation.py b/erpnext/accounts/doctype/bank_clearance/bank_clearance.py similarity index 99% rename from erpnext/accounts/doctype/bank_reconciliation/bank_reconciliation.py rename to erpnext/accounts/doctype/bank_clearance/bank_clearance.py index 48fd154a4d..6fec3ab368 100644 --- a/erpnext/accounts/doctype/bank_reconciliation/bank_reconciliation.py +++ b/erpnext/accounts/doctype/bank_clearance/bank_clearance.py @@ -11,7 +11,7 @@ form_grid_templates = { "journal_entries": "templates/form_grid/bank_reconciliation_grid.html" } -class BankReconciliation(Document): +class BankClearance(Document): def get_payment_entries(self): if not (self.from_date and self.to_date): frappe.throw(_("From Date and To Date are Mandatory")) diff --git a/erpnext/accounts/doctype/bank_clearance/test_bank_clearance.py b/erpnext/accounts/doctype/bank_clearance/test_bank_clearance.py new file mode 100644 index 0000000000..833abde5ce --- /dev/null +++ b/erpnext/accounts/doctype/bank_clearance/test_bank_clearance.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 TestBankClearance(unittest.TestCase): + pass diff --git a/erpnext/accounts/doctype/bank_clearance_detail/README.md b/erpnext/accounts/doctype/bank_clearance_detail/README.md new file mode 100644 index 0000000000..ee83a44765 --- /dev/null +++ b/erpnext/accounts/doctype/bank_clearance_detail/README.md @@ -0,0 +1 @@ +Detail of transaction for parent Bank Clearance. \ No newline at end of file diff --git a/erpnext/accounts/doctype/bank_reconciliation/__init__.py b/erpnext/accounts/doctype/bank_clearance_detail/__init__.py similarity index 100% rename from erpnext/accounts/doctype/bank_reconciliation/__init__.py rename to erpnext/accounts/doctype/bank_clearance_detail/__init__.py diff --git a/erpnext/accounts/doctype/bank_reconciliation_detail/bank_reconciliation_detail.json b/erpnext/accounts/doctype/bank_clearance_detail/bank_clearance_detail.json similarity index 99% rename from erpnext/accounts/doctype/bank_reconciliation_detail/bank_reconciliation_detail.json rename to erpnext/accounts/doctype/bank_clearance_detail/bank_clearance_detail.json index 183068c3ae..04988bf66d 100644 --- a/erpnext/accounts/doctype/bank_reconciliation_detail/bank_reconciliation_detail.json +++ b/erpnext/accounts/doctype/bank_clearance_detail/bank_clearance_detail.json @@ -326,7 +326,7 @@ "modified": "2019-01-07 16:52:07.174687", "modified_by": "Administrator", "module": "Accounts", - "name": "Bank Reconciliation Detail", + "name": "Bank Clearance Detail", "owner": "Administrator", "permissions": [], "quick_entry": 1, diff --git a/erpnext/accounts/doctype/bank_reconciliation_detail/bank_reconciliation_detail.py b/erpnext/accounts/doctype/bank_clearance_detail/bank_clearance_detail.py similarity index 84% rename from erpnext/accounts/doctype/bank_reconciliation_detail/bank_reconciliation_detail.py rename to erpnext/accounts/doctype/bank_clearance_detail/bank_clearance_detail.py index 990b2a640f..ecc536733f 100644 --- a/erpnext/accounts/doctype/bank_reconciliation_detail/bank_reconciliation_detail.py +++ b/erpnext/accounts/doctype/bank_clearance_detail/bank_clearance_detail.py @@ -5,5 +5,5 @@ from __future__ import unicode_literals import frappe from frappe.model.document import Document -class BankReconciliationDetail(Document): +class BankClearanceDetail(Document): pass \ No newline at end of file diff --git a/erpnext/accounts/doctype/bank_reconciliation/bank_reconciliation.json b/erpnext/accounts/doctype/bank_reconciliation/bank_reconciliation.json deleted file mode 100644 index b85ef3e9c4..0000000000 --- a/erpnext/accounts/doctype/bank_reconciliation/bank_reconciliation.json +++ /dev/null @@ -1,484 +0,0 @@ -{ - "allow_copy": 1, - "allow_events_in_timeline": 0, - "allow_guest_to_view": 0, - "allow_import": 0, - "allow_rename": 0, - "beta": 0, - "creation": "2013-01-10 16:34:05", - "custom": 0, - "docstatus": 0, - "doctype": "DocType", - "document_type": "Document", - "editable_grid": 0, - "fields": [ - { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fetch_from": "bank_account.account", - "fetch_if_empty": 1, - "fieldname": "account", - "fieldtype": "Link", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 1, - "in_standard_filter": 0, - "label": "Account", - "length": 0, - "no_copy": 0, - "options": "Account", - "permlevel": 0, - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 1, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, - "unique": 0 - }, - { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fetch_if_empty": 0, - "fieldname": "account_currency", - "fieldtype": "Link", - "hidden": 1, - "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 Currency", - "length": 0, - "no_copy": 0, - "options": "Currency", - "permlevel": 0, - "print_hide": 1, - "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": 0 - }, - { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fetch_if_empty": 0, - "fieldname": "from_date", - "fieldtype": "Date", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 1, - "in_standard_filter": 0, - "label": "From Date", - "length": 0, - "no_copy": 0, - "permlevel": 0, - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 1, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, - "unique": 0 - }, - { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fetch_if_empty": 0, - "fieldname": "to_date", - "fieldtype": "Date", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 1, - "in_standard_filter": 0, - "label": "To Date", - "length": 0, - "no_copy": 0, - "permlevel": 0, - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 1, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, - "unique": 0 - }, - { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fetch_if_empty": 0, - "fieldname": "column_break_5", - "fieldtype": "Column Break", - "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, - "length": 0, - "no_copy": 0, - "permlevel": 0, - "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": 0 - }, - { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "description": "Select the Bank Account to reconcile.", - "fetch_if_empty": 0, - "fieldname": "bank_account", - "fieldtype": "Link", - "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": "Bank Account", - "length": 0, - "no_copy": 0, - "options": "Bank Account", - "permlevel": 0, - "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": 0 - }, - { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fetch_if_empty": 0, - "fieldname": "include_reconciled_entries", - "fieldtype": "Check", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 1, - "in_standard_filter": 0, - "label": "Include Reconciled Entries", - "length": 0, - "no_copy": 0, - "permlevel": 0, - "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": 0 - }, - { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fetch_if_empty": 0, - "fieldname": "include_pos_transactions", - "fieldtype": "Check", - "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": "Include POS Transactions", - "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": 0 - }, - { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fetch_if_empty": 0, - "fieldname": "get_payment_entries", - "fieldtype": "Button", - "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": "Get Payment Entries", - "length": 0, - "no_copy": 0, - "options": "", - "permlevel": 0, - "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": 0 - }, - { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fetch_if_empty": 0, - "fieldname": "section_break_10", - "fieldtype": "Section Break", - "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, - "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": 0 - }, - { - "allow_bulk_edit": 1, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fetch_if_empty": 0, - "fieldname": "payment_entries", - "fieldtype": "Table", - "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": "Payment Entries", - "length": 0, - "no_copy": 0, - "options": "Bank Reconciliation Detail", - "permlevel": 0, - "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": 0 - }, - { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fetch_if_empty": 0, - "fieldname": "update_clearance_date", - "fieldtype": "Button", - "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": "Update Clearance Date", - "length": 0, - "no_copy": 0, - "options": "", - "permlevel": 0, - "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": 0 - }, - { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fetch_if_empty": 0, - "fieldname": "total_amount", - "fieldtype": "Currency", - "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": "Total Amount", - "length": 0, - "no_copy": 0, - "options": "account_currency", - "permlevel": 0, - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 1, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, - "unique": 0 - } - ], - "has_web_view": 0, - "hide_toolbar": 1, - "icon": "fa fa-check", - "idx": 1, - "in_create": 0, - "is_submittable": 0, - "issingle": 1, - "istable": 0, - "max_attachments": 0, - "menu_index": 0, - "modified": "2020-01-22 00:00:00.000000", - "modified_by": "Administrator", - "module": "Accounts", - "name": "Bank Reconciliation", - "owner": "Administrator", - "permissions": [ - { - "amend": 0, - "cancel": 0, - "create": 1, - "delete": 0, - "email": 0, - "export": 0, - "if_owner": 0, - "import": 0, - "permlevel": 0, - "print": 0, - "read": 1, - "report": 0, - "role": "Accounts User", - "set_user_permissions": 0, - "share": 1, - "submit": 0, - "write": 1 - } - ], - "quick_entry": 1, - "read_only": 1, - "show_name_in_global_search": 0, - "sort_order": "ASC", - "track_changes": 0, - "track_seen": 0, - "track_views": 0 -} diff --git a/erpnext/accounts/doctype/bank_reconciliation/test_bank_reconciliation.js b/erpnext/accounts/doctype/bank_reconciliation/test_bank_reconciliation.js deleted file mode 100644 index f52f6fb431..0000000000 --- a/erpnext/accounts/doctype/bank_reconciliation/test_bank_reconciliation.js +++ /dev/null @@ -1,22 +0,0 @@ -QUnit.module('Account'); - -QUnit.test("test Bank Reconciliation", function(assert) { - assert.expect(0); - let done = assert.async(); - frappe.run_serially([ - () => frappe.set_route('Form', 'Bank Reconciliation'), - () => cur_frm.set_value('bank_account','Cash - FT'), - () => frappe.click_button('Get Payment Entries'), - () => { - for(var i=0;i<=cur_frm.doc.payment_entries.length-1;i++){ - cur_frm.doc.payment_entries[i].clearance_date = frappe.datetime.add_days(frappe.datetime.now_date(), 2); - } - }, - () => {cur_frm.refresh_fields('payment_entries');}, - () => frappe.click_button('Update Clearance Date'), - () => frappe.timeout(0.5), - () => frappe.click_button('Close'), - () => done() - ]); -}); - diff --git a/erpnext/accounts/doctype/bank_reconciliation/test_bank_reconciliation.py b/erpnext/accounts/doctype/bank_reconciliation/test_bank_reconciliation.py deleted file mode 100644 index 932fb3384c..0000000000 --- a/erpnext/accounts/doctype/bank_reconciliation/test_bank_reconciliation.py +++ /dev/null @@ -1,8 +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 TestBankReconciliation(unittest.TestCase): - pass diff --git a/erpnext/accounts/doctype/bank_reconciliation_detail/README.md b/erpnext/accounts/doctype/bank_reconciliation_detail/README.md deleted file mode 100644 index 07d0731ed2..0000000000 --- a/erpnext/accounts/doctype/bank_reconciliation_detail/README.md +++ /dev/null @@ -1 +0,0 @@ -Detail of transaction for parent Bank Reconciliation. \ No newline at end of file diff --git a/erpnext/accounts/doctype/bank_reconciliation_detail/__init__.py b/erpnext/accounts/doctype/bank_reconciliation_detail/__init__.py deleted file mode 100644 index baffc48825..0000000000 --- a/erpnext/accounts/doctype/bank_reconciliation_detail/__init__.py +++ /dev/null @@ -1 +0,0 @@ -from __future__ import unicode_literals diff --git a/erpnext/config/accounts.py b/erpnext/config/accounts.py index 08711fc09e..b9b0da48c9 100644 --- a/erpnext/config/accounts.py +++ b/erpnext/config/accounts.py @@ -183,8 +183,8 @@ def get_data(): }, { "type": "doctype", - "label": _("Update Bank Transaction Dates"), - "name": "Bank Reconciliation", + "label": _("Update Bank Clearance Dates"), + "name": "Bank Clearance", "description": _("Update bank payment dates with journals.") }, { diff --git a/erpnext/patches/v12_0/rename_bank_reconciliation.py b/erpnext/patches/v12_0/rename_bank_reconciliation.py new file mode 100644 index 0000000000..556224490c --- /dev/null +++ b/erpnext/patches/v12_0/rename_bank_reconciliation.py @@ -0,0 +1,14 @@ +# Copyright (c) 2018, Frappe and Contributors +# License: GNU General Public License v3. See license.txt + +from __future__ import unicode_literals +import frappe +from frappe.model.utils.rename_field import rename_field + +def execute(): + if frappe.db.table_exists("Bank Reconciliation"): + frappe.rename_doc('DocType', 'Bank Reconciliation', 'Bank Clearance', force=True) + frappe.reload_doc('Accounts', 'doctype', 'Bank Clearance') + + frappe.rename_doc('DocType', 'Bank Reconciliation Detail', 'Bank Clearance Detail', force=True) + frappe.reload_doc('Accounts', 'doctype', 'Bank Clearance Detail') diff --git a/erpnext/patches/v12_0/rename_bank_reconciliation_fields.py b/erpnext/patches/v12_0/rename_bank_reconciliation_fields.py index caeda8ae61..978b1c92b9 100644 --- a/erpnext/patches/v12_0/rename_bank_reconciliation_fields.py +++ b/erpnext/patches/v12_0/rename_bank_reconciliation_fields.py @@ -9,6 +9,6 @@ def _rename_single_field(**kwargs): frappe.db.sql("UPDATE tabSingles SET field='{new_name}' WHERE doctype='{doctype}' AND field='{old_name}';".format(**kwargs)) #nosec def execute(): - _rename_single_field(doctype = "Bank Reconciliation", old_name = "bank_account" , new_name = "account") - _rename_single_field(doctype = "Bank Reconciliation", old_name = "bank_account_no", new_name = "bank_account") - frappe.reload_doc("Accounts", "doctype", "Bank Reconciliation") + _rename_single_field(doctype = "Bank Clearance", old_name = "bank_account" , new_name = "account") + _rename_single_field(doctype = "Bank Clearance", old_name = "bank_account_no", new_name = "bank_account") + frappe.reload_doc("Accounts", "doctype", "Bank Clearance") From 9de76de621707d50a1e9376a9b20c63a4bcab160 Mon Sep 17 00:00:00 2001 From: Saqib Ansari Date: Mon, 20 Apr 2020 12:19:27 +0530 Subject: [PATCH 02/12] fix: patch --- .../desk_page/accounting/accounting.json | 2 +- erpnext/patches.txt | 1 + .../patches/v12_0/rename_bank_reconciliation.py | 16 +++++++++------- 3 files changed, 11 insertions(+), 8 deletions(-) diff --git a/erpnext/accounts/desk_page/accounting/accounting.json b/erpnext/accounts/desk_page/accounting/accounting.json index 7a777f9fd2..d0b747d83f 100644 --- a/erpnext/accounts/desk_page/accounting/accounting.json +++ b/erpnext/accounts/desk_page/accounting/accounting.json @@ -39,7 +39,7 @@ "title": "Bank Statement" }, { - "links": "[\n {\n \"description\": \"Match non-linked Invoices and Payments.\",\n \"label\": \"Match Payments with Invoices\",\n \"name\": \"Payment Reconciliation\",\n \"type\": \"doctype\"\n },\n {\n \"description\": \"Update bank payment dates with journals.\",\n \"label\": \"Update Bank Transaction Dates\",\n \"name\": \"Bank Reconciliation\",\n \"type\": \"doctype\"\n },\n {\n \"label\": \"Invoice Discounting\",\n \"name\": \"Invoice Discounting\",\n \"type\": \"doctype\"\n },\n {\n \"dependencies\": [\n \"Journal Entry\"\n ],\n \"doctype\": \"Journal Entry\",\n \"is_query_report\": true,\n \"label\": \"Bank Reconciliation Statement\",\n \"name\": \"Bank Reconciliation Statement\",\n \"type\": \"report\"\n },\n {\n \"icon\": \"fa fa-bar-chart\",\n \"label\": \"Bank Reconciliation\",\n \"name\": \"bank-reconciliation\",\n \"type\": \"page\"\n },\n {\n \"dependencies\": [\n \"Journal Entry\"\n ],\n \"doctype\": \"Journal Entry\",\n \"is_query_report\": true,\n \"label\": \"Bank Clearance Summary\",\n \"name\": \"Bank Clearance Summary\",\n \"type\": \"report\"\n },\n {\n \"label\": \"Bank Guarantee\",\n \"name\": \"Bank Guarantee\",\n \"type\": \"doctype\"\n },\n {\n \"description\": \"Setup cheque dimensions for printing\",\n \"label\": \"Cheque Print Template\",\n \"name\": \"Cheque Print Template\",\n \"type\": \"doctype\"\n }\n]", + "links": "[\n {\n \"description\": \"Match non-linked Invoices and Payments.\",\n \"label\": \"Match Payments with Invoices\",\n \"name\": \"Payment Reconciliation\",\n \"type\": \"doctype\"\n },\n {\n \"description\": \"Update bank payment dates with journals.\",\n \"label\": \"Update Bank Clearance Dates\",\n \"name\": \"Bank Clearance\",\n \"type\": \"doctype\"\n },\n {\n \"label\": \"Invoice Discounting\",\n \"name\": \"Invoice Discounting\",\n \"type\": \"doctype\"\n },\n {\n \"dependencies\": [\n \"Journal Entry\"\n ],\n \"doctype\": \"Journal Entry\",\n \"is_query_report\": true,\n \"label\": \"Bank Reconciliation Statement\",\n \"name\": \"Bank Reconciliation Statement\",\n \"type\": \"report\"\n },\n {\n \"icon\": \"fa fa-bar-chart\",\n \"label\": \"Bank Reconciliation\",\n \"name\": \"bank-reconciliation\",\n \"type\": \"page\"\n },\n {\n \"dependencies\": [\n \"Journal Entry\"\n ],\n \"doctype\": \"Journal Entry\",\n \"is_query_report\": true,\n \"label\": \"Bank Clearance Summary\",\n \"name\": \"Bank Clearance Summary\",\n \"type\": \"report\"\n },\n {\n \"label\": \"Bank Guarantee\",\n \"name\": \"Bank Guarantee\",\n \"type\": \"doctype\"\n },\n {\n \"description\": \"Setup cheque dimensions for printing\",\n \"label\": \"Cheque Print Template\",\n \"name\": \"Cheque Print Template\",\n \"type\": \"doctype\"\n }\n]", "title": "Banking and Payments" }, { diff --git a/erpnext/patches.txt b/erpnext/patches.txt index 9ddd7cc24d..ff58f40d37 100644 --- a/erpnext/patches.txt +++ b/erpnext/patches.txt @@ -660,5 +660,6 @@ erpnext.patches.v12_0.set_published_in_hub_tracked_item erpnext.patches.v12_0.set_job_offer_applicant_email 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 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 \ No newline at end of file diff --git a/erpnext/patches/v12_0/rename_bank_reconciliation.py b/erpnext/patches/v12_0/rename_bank_reconciliation.py index 556224490c..eda47a95e0 100644 --- a/erpnext/patches/v12_0/rename_bank_reconciliation.py +++ b/erpnext/patches/v12_0/rename_bank_reconciliation.py @@ -3,12 +3,14 @@ from __future__ import unicode_literals import frappe -from frappe.model.utils.rename_field import rename_field def execute(): - if frappe.db.table_exists("Bank Reconciliation"): - frappe.rename_doc('DocType', 'Bank Reconciliation', 'Bank Clearance', force=True) - frappe.reload_doc('Accounts', 'doctype', 'Bank Clearance') - - frappe.rename_doc('DocType', 'Bank Reconciliation Detail', 'Bank Clearance Detail', force=True) - frappe.reload_doc('Accounts', 'doctype', 'Bank Clearance Detail') + if frappe.db.table_exists("Bank Reconciliation"): + frappe.rename_doc('DocType', 'Bank Reconciliation', 'Bank Clearance', force=True) + frappe.reload_doc('Accounts', 'doctype', 'Bank Clearance') + + frappe.rename_doc('DocType', 'Bank Reconciliation Detail', 'Bank Clearance Detail', force=True) + frappe.reload_doc('Accounts', 'doctype', 'Bank Clearance Detail') + + frappe.delete_doc("DocType", "Bank Reconciliation") + frappe.delete_doc("DocType", "Bank Reconciliation Detail") From 64c7eeed24875e840eeebc76155142452648339b Mon Sep 17 00:00:00 2001 From: Wolfram Schmidt Date: Sun, 26 Apr 2020 10:56:08 +0200 Subject: [PATCH 03/12] Update in field type Warrenty Period (in Days) changed from "Data" to "Int". --- erpnext/stock/doctype/item/item.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/erpnext/stock/doctype/item/item.json b/erpnext/stock/doctype/item/item.json index 7d2e3112fb..b96dc28195 100644 --- a/erpnext/stock/doctype/item/item.json +++ b/erpnext/stock/doctype/item/item.json @@ -382,7 +382,7 @@ { "depends_on": "eval:doc.is_stock_item", "fieldname": "warranty_period", - "fieldtype": "Data", + "fieldtype": "Int", "label": "Warranty Period (in days)", "oldfieldname": "warranty_period", "oldfieldtype": "Data" @@ -1122,4 +1122,4 @@ "sort_order": "DESC", "title_field": "item_name", "track_changes": 1 -} \ No newline at end of file +} From acfe8f020f4ba4eb440609c35febdf142f563880 Mon Sep 17 00:00:00 2001 From: Wolfram Schmidt Date: Mon, 27 Apr 2020 08:48:34 +0200 Subject: [PATCH 04/12] added time stamp to commit added time stamp to commit --- erpnext/stock/doctype/item/item.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/stock/doctype/item/item.json b/erpnext/stock/doctype/item/item.json index b96dc28195..968fa68791 100644 --- a/erpnext/stock/doctype/item/item.json +++ b/erpnext/stock/doctype/item/item.json @@ -1060,7 +1060,7 @@ "image_field": "image", "links": [], "max_attachments": 1, - "modified": "2020-04-07 15:56:06.195722", + "modified": "2020-04-27 08:46:06.195722", "modified_by": "Administrator", "module": "Stock", "name": "Item", From 769c0ce72bfe81e6f696fffbee2fd3ef50d1d5c5 Mon Sep 17 00:00:00 2001 From: Saqib Ansari Date: Wed, 29 Apr 2020 15:19:08 +0530 Subject: [PATCH 05/12] chore: validate and warn payment against paid invoices --- .../doctype/payment_entry/payment_entry.py | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/erpnext/accounts/doctype/payment_entry/payment_entry.py b/erpnext/accounts/doctype/payment_entry/payment_entry.py index b53e68ff73..3ecac57f32 100644 --- a/erpnext/accounts/doctype/payment_entry/payment_entry.py +++ b/erpnext/accounts/doctype/payment_entry/payment_entry.py @@ -60,6 +60,7 @@ class PaymentEntry(AccountsController): self.set_remarks() self.validate_duplicate_entry() self.validate_allocated_amount() + self.validate_paid_invoices() self.ensure_supplier_is_not_blocked() self.set_status() @@ -265,6 +266,25 @@ class PaymentEntry(AccountsController): frappe.throw(_("{0} {1} must be submitted") .format(d.reference_doctype, d.reference_name)) + def validate_paid_invoices(self): + no_oustanding_refs = {} + + for d in self.get("references"): + if not d.allocated_amount: + continue + + if d.reference_doctype in ("Sales Invoice", "Purchase Invoice", "Fees"): + outstanding_amount = frappe.get_cached_value(d.reference_doctype, d.reference_name, "outstanding_amount") + if outstanding_amount <= 0: + no_oustanding_refs.setdefault(d.reference_doctype, []).append(d) + + for k, v in no_oustanding_refs.items(): + frappe.msgprint(_("{} - {} now have {} as they had no outstanding amount left before submitting the Payment Entry. \n \ + If this is undesirable please cancel the corresponding Payment Entry.") + .format(k, frappe.bold(", ".join([d.reference_name for d in v])), frappe.bold("negative outstanding amount")), + title=_("Warning"), indicator="orange") + + def validate_journal_entry(self): for d in self.get("references"): if d.allocated_amount and d.reference_doctype == "Journal Entry": From c6041092876312306b2cca78069d71b4f3174bf7 Mon Sep 17 00:00:00 2001 From: Saqib Ansari Date: Thu, 30 Apr 2020 13:23:59 +0530 Subject: [PATCH 06/12] chore: handle credit note validation --- erpnext/accounts/doctype/payment_entry/payment_entry.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/erpnext/accounts/doctype/payment_entry/payment_entry.py b/erpnext/accounts/doctype/payment_entry/payment_entry.py index 3ecac57f32..27596af081 100644 --- a/erpnext/accounts/doctype/payment_entry/payment_entry.py +++ b/erpnext/accounts/doctype/payment_entry/payment_entry.py @@ -274,12 +274,12 @@ class PaymentEntry(AccountsController): continue if d.reference_doctype in ("Sales Invoice", "Purchase Invoice", "Fees"): - outstanding_amount = frappe.get_cached_value(d.reference_doctype, d.reference_name, "outstanding_amount") - if outstanding_amount <= 0: + outstanding_amount, is_return = frappe.get_cached_value(d.reference_doctype, d.reference_name, ["outstanding_amount", "is_return"]) + if outstanding_amount <= 0 and not is_return: no_oustanding_refs.setdefault(d.reference_doctype, []).append(d) for k, v in no_oustanding_refs.items(): - frappe.msgprint(_("{} - {} now have {} as they had no outstanding amount left before submitting the Payment Entry. \n \ + frappe.msgprint(_("{} - {} now have {} as they had no outstanding amount left before submitting the Payment Entry.

\ If this is undesirable please cancel the corresponding Payment Entry.") .format(k, frappe.bold(", ".join([d.reference_name for d in v])), frappe.bold("negative outstanding amount")), title=_("Warning"), indicator="orange") From 2dbd228eabd6a35af18c59540b85ef2e581d0bb6 Mon Sep 17 00:00:00 2001 From: Deepesh Garg Date: Fri, 1 May 2020 09:50:56 +0530 Subject: [PATCH 07/12] fix: Check is child table for POS profile user --- .../pos_profile_user/pos_profile_user.json | 150 ++++-------------- 1 file changed, 33 insertions(+), 117 deletions(-) diff --git a/erpnext/accounts/doctype/pos_profile_user/pos_profile_user.json b/erpnext/accounts/doctype/pos_profile_user/pos_profile_user.json index 2fb66d227b..59a673e3a5 100644 --- a/erpnext/accounts/doctype/pos_profile_user/pos_profile_user.json +++ b/erpnext/accounts/doctype/pos_profile_user/pos_profile_user.json @@ -1,123 +1,39 @@ { - "allow_copy": 0, - "allow_guest_to_view": 0, - "allow_import": 0, - "allow_rename": 0, - "beta": 0, - "creation": "2017-10-27 16:46:06.060930", - "custom": 0, - "docstatus": 0, - "doctype": "DocType", - "document_type": "", - "editable_grid": 1, - "engine": "InnoDB", + "actions": [], + "creation": "2017-10-27 16:46:06.060930", + "doctype": "DocType", + "editable_grid": 1, + "engine": "InnoDB", + "field_order": [ + "default", + "user" + ], "fields": [ { - "allow_bulk_edit": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fieldname": "default", - "fieldtype": "Check", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 1, - "in_standard_filter": 0, - "label": "Default", - "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, - "unique": 0 - }, + "default": "0", + "fieldname": "default", + "fieldtype": "Check", + "in_list_view": 1, + "label": "Default" + }, { - "allow_bulk_edit": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fieldname": "user", - "fieldtype": "Link", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 1, - "in_standard_filter": 0, - "label": "User", - "length": 0, - "no_copy": 0, - "options": "User", - "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, - "unique": 0 + "fieldname": "user", + "fieldtype": "Link", + "in_list_view": 1, + "label": "User", + "options": "User" } - ], - "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": "2017-11-23 17:13:16.005475", - "modified_by": "Administrator", - "module": "Accounts", - "name": "POS Profile User", - "name_case": "", - "owner": "Administrator", - "permissions": [ - { - "amend": 0, - "apply_user_permissions": 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 - } - ], - "quick_entry": 1, - "read_only": 0, - "read_only_onload": 0, - "show_name_in_global_search": 0, - "sort_field": "modified", - "sort_order": "DESC", - "track_changes": 1, - "track_seen": 0 + ], + "istable": 1, + "links": [], + "modified": "2020-05-01 09:46:47.599173", + "modified_by": "Administrator", + "module": "Accounts", + "name": "POS Profile User", + "owner": "Administrator", + "permissions": [], + "quick_entry": 1, + "sort_field": "modified", + "sort_order": "DESC", + "track_changes": 1 } \ No newline at end of file From be16e5cccc59b6c6169ae1e5ebe1ff6b083979e7 Mon Sep 17 00:00:00 2001 From: rohitwaghchaure Date: Fri, 1 May 2020 10:50:17 +0530 Subject: [PATCH 08/12] fix: 'NoneType' object is not iterable (#21537) --- erpnext/stock/get_item_details.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/erpnext/stock/get_item_details.py b/erpnext/stock/get_item_details.py index 61429cc1c1..c5ba686f89 100644 --- a/erpnext/stock/get_item_details.py +++ b/erpnext/stock/get_item_details.py @@ -342,8 +342,14 @@ def get_basic_details(args, item, overwrite_warehouse=True): out["manufacturer_part_no"] = None out["manufacturer"] = None else: - out["manufacturer"], out["manufacturer_part_no"] = frappe.get_value("Item", item.name, - ["default_item_manufacturer", "default_manufacturer_part_no"] ) + data = frappe.get_value("Item", item.name, + ["default_item_manufacturer", "default_manufacturer_part_no"] , as_dict=1) + + if data: + out.update({ + "manufacturer": data.default_item_manufacturer, + "manufacturer_part_no": data.default_manufacturer_part_no + }) child_doctype = args.doctype + ' Item' meta = frappe.get_meta(child_doctype) From 779815a035a67de307fe0f694b36d03d7d598bdb Mon Sep 17 00:00:00 2001 From: Deepesh Garg Date: Fri, 1 May 2020 11:04:12 +0530 Subject: [PATCH 09/12] fix: Loan Repayment Test --- erpnext/loan_management/doctype/loan/test_loan.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/loan_management/doctype/loan/test_loan.py b/erpnext/loan_management/doctype/loan/test_loan.py index 2d1ad33ed0..90b8534bc8 100644 --- a/erpnext/loan_management/doctype/loan/test_loan.py +++ b/erpnext/loan_management/doctype/loan/test_loan.py @@ -236,7 +236,7 @@ class TestLoan(unittest.TestCase): process_loan_interest_accrual_for_term_loans(posting_date=nowdate()) - repayment_entry = create_repayment_entry(loan.name, self.applicant2, add_days(get_last_day(nowdate()), 5), + repayment_entry = create_repayment_entry(loan.name, self.applicant2, add_days(nowdate(), 5), "Regular Payment", 89768.75) repayment_entry.submit() From 6cce75a230618e0f0db3aec48f84f2e4cd3ec3d0 Mon Sep 17 00:00:00 2001 From: Deepesh Garg <42651287+deepeshgarg007@users.noreply.github.com> Date: Fri, 1 May 2020 12:03:18 +0530 Subject: [PATCH 10/12] Revert "fix: Update in field type" --- erpnext/stock/doctype/item/item.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/erpnext/stock/doctype/item/item.json b/erpnext/stock/doctype/item/item.json index 968fa68791..7d2e3112fb 100644 --- a/erpnext/stock/doctype/item/item.json +++ b/erpnext/stock/doctype/item/item.json @@ -382,7 +382,7 @@ { "depends_on": "eval:doc.is_stock_item", "fieldname": "warranty_period", - "fieldtype": "Int", + "fieldtype": "Data", "label": "Warranty Period (in days)", "oldfieldname": "warranty_period", "oldfieldtype": "Data" @@ -1060,7 +1060,7 @@ "image_field": "image", "links": [], "max_attachments": 1, - "modified": "2020-04-27 08:46:06.195722", + "modified": "2020-04-07 15:56:06.195722", "modified_by": "Administrator", "module": "Stock", "name": "Item", @@ -1122,4 +1122,4 @@ "sort_order": "DESC", "title_field": "item_name", "track_changes": 1 -} +} \ No newline at end of file From 998364d63662994b08120bd243ed4bec01b70730 Mon Sep 17 00:00:00 2001 From: Deepesh Garg <42651287+deepeshgarg007@users.noreply.github.com> Date: Fri, 1 May 2020 12:04:13 +0530 Subject: [PATCH 11/12] fix: Update timestamp --- erpnext/stock/doctype/item/item.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/erpnext/stock/doctype/item/item.json b/erpnext/stock/doctype/item/item.json index 7d2e3112fb..c371999a27 100644 --- a/erpnext/stock/doctype/item/item.json +++ b/erpnext/stock/doctype/item/item.json @@ -1060,7 +1060,7 @@ "image_field": "image", "links": [], "max_attachments": 1, - "modified": "2020-04-07 15:56:06.195722", + "modified": "2020-04-08 15:56:06.195722", "modified_by": "Administrator", "module": "Stock", "name": "Item", @@ -1122,4 +1122,4 @@ "sort_order": "DESC", "title_field": "item_name", "track_changes": 1 -} \ No newline at end of file +} From 032814b86a762f5544e933edd40933a02904aa13 Mon Sep 17 00:00:00 2001 From: Deepesh Garg Date: Fri, 1 May 2020 13:26:26 +0530 Subject: [PATCH 12/12] fix: Patch test --- .../allowed_to_transact_with.json | 96 ++++++------------- .../patches/v12_0/add_default_dashboards.py | 1 + .../create_irs_1099_field_united_states.py | 11 ++- 3 files changed, 35 insertions(+), 73 deletions(-) diff --git a/erpnext/accounts/doctype/allowed_to_transact_with/allowed_to_transact_with.json b/erpnext/accounts/doctype/allowed_to_transact_with/allowed_to_transact_with.json index f85bc52713..e3f2d59c06 100644 --- a/erpnext/accounts/doctype/allowed_to_transact_with/allowed_to_transact_with.json +++ b/erpnext/accounts/doctype/allowed_to_transact_with/allowed_to_transact_with.json @@ -1,74 +1,32 @@ { - "allow_copy": 0, - "allow_guest_to_view": 0, - "allow_import": 0, - "allow_rename": 0, - "beta": 0, - "creation": "2018-04-16 21:50:05.860195", - "custom": 0, - "docstatus": 0, - "doctype": "DocType", - "document_type": "", - "editable_grid": 1, - "engine": "InnoDB", + "actions": [], + "creation": "2018-04-16 21:50:05.860195", + "doctype": "DocType", + "editable_grid": 1, + "engine": "InnoDB", + "field_order": [ + "company" + ], "fields": [ { - "allow_bulk_edit": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "default": "", - "fieldname": "company", - "fieldtype": "Link", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 1, - "in_standard_filter": 0, - "label": "Company", - "length": 0, - "no_copy": 0, - "options": "Company", - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 1, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, - "unique": 0 + "fieldname": "company", + "fieldtype": "Link", + "in_list_view": 1, + "label": "Company", + "options": "Company", + "reqd": 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": 1, - "max_attachments": 0, - "modified": "2018-04-20 14:00:46.014502", - "modified_by": "Administrator", - "module": "Accounts", - "name": "Allowed To Transact With", - "name_case": "", - "owner": "Administrator", - "permissions": [], - "quick_entry": 1, - "read_only": 0, - "read_only_onload": 0, - "show_name_in_global_search": 0, - "sort_field": "modified", - "sort_order": "DESC", - "track_changes": 1, - "track_seen": 0 + ], + "istable": 1, + "links": [], + "modified": "2020-05-01 12:32:34.044911", + "modified_by": "Administrator", + "module": "Accounts", + "name": "Allowed To Transact With", + "owner": "Administrator", + "permissions": [], + "quick_entry": 1, + "sort_field": "modified", + "sort_order": "DESC", + "track_changes": 1 } \ No newline at end of file diff --git a/erpnext/patches/v12_0/add_default_dashboards.py b/erpnext/patches/v12_0/add_default_dashboards.py index ab92fbaa69..0c3f2f86ae 100644 --- a/erpnext/patches/v12_0/add_default_dashboards.py +++ b/erpnext/patches/v12_0/add_default_dashboards.py @@ -5,4 +5,5 @@ import frappe from erpnext.setup.setup_wizard.operations.install_fixtures import add_dashboards def execute(): + frappe.reload_doc("desk", "doctype", "number_card_link") add_dashboards() diff --git a/erpnext/patches/v12_0/create_irs_1099_field_united_states.py b/erpnext/patches/v12_0/create_irs_1099_field_united_states.py index 3e4c87f434..82c8f5c414 100644 --- a/erpnext/patches/v12_0/create_irs_1099_field_united_states.py +++ b/erpnext/patches/v12_0/create_irs_1099_field_united_states.py @@ -3,8 +3,11 @@ import frappe from erpnext.regional.united_states.setup import make_custom_fields def execute(): - company = frappe.get_all('Company', filters = {'country': 'United States'}) - if not company: - return - make_custom_fields() \ No newline at end of file + frappe.reload_doc('accounts', 'doctype', 'allowed_to_transact_with', force=True) + + company = frappe.get_all('Company', filters = {'country': 'United States'}) + if not company: + return + + make_custom_fields() \ No newline at end of file