From a6fbb80b941b40dc021824d3accec8e1cf852c22 Mon Sep 17 00:00:00 2001 From: ruthra kumar Date: Wed, 7 Sep 2022 11:18:20 +0530 Subject: [PATCH] fix: import error on bank statement import Name collision between frameworks file importer's internal log and doctype fieldname - import_log. Frameworks internal log overrode, doctypes field which caused failure in basic fieldtype validation. --- .../bank_statement_import.js | 6 +++--- .../bank_statement_import.json | 16 ++++++++-------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/erpnext/accounts/doctype/bank_statement_import/bank_statement_import.js b/erpnext/accounts/doctype/bank_statement_import/bank_statement_import.js index a964965c26..f74562086e 100644 --- a/erpnext/accounts/doctype/bank_statement_import/bank_statement_import.js +++ b/erpnext/accounts/doctype/bank_statement_import/bank_statement_import.js @@ -141,7 +141,7 @@ frappe.ui.form.on("Bank Statement Import", { }, show_import_status(frm) { - let import_log = JSON.parse(frm.doc.import_log || "[]"); + let import_log = JSON.parse(frm.doc.statement_import_log || "[]"); let successful_records = import_log.filter((log) => log.success); let failed_records = import_log.filter((log) => !log.success); if (successful_records.length === 0) return; @@ -309,7 +309,7 @@ frappe.ui.form.on("Bank Statement Import", { // method: 'frappe.core.doctype.data_import.data_import.get_preview_from_template', show_import_preview(frm, preview_data) { - let import_log = JSON.parse(frm.doc.import_log || "[]"); + let import_log = JSON.parse(frm.doc.statement_import_log || "[]"); if ( frm.import_preview && @@ -439,7 +439,7 @@ frappe.ui.form.on("Bank Statement Import", { }, show_import_log(frm) { - let import_log = JSON.parse(frm.doc.import_log || "[]"); + let import_log = JSON.parse(frm.doc.statement_import_log || "[]"); let logs = import_log; frm.toggle_display("import_log", false); frm.toggle_display("import_log_section", logs.length > 0); diff --git a/erpnext/accounts/doctype/bank_statement_import/bank_statement_import.json b/erpnext/accounts/doctype/bank_statement_import/bank_statement_import.json index 7ffff02850..eede3bdc6d 100644 --- a/erpnext/accounts/doctype/bank_statement_import/bank_statement_import.json +++ b/erpnext/accounts/doctype/bank_statement_import/bank_statement_import.json @@ -24,7 +24,7 @@ "section_import_preview", "import_preview", "import_log_section", - "import_log", + "statement_import_log", "show_failed_logs", "import_log_preview", "reference_doctype", @@ -90,12 +90,6 @@ "options": "JSON", "read_only": 1 }, - { - "fieldname": "import_log", - "fieldtype": "Code", - "label": "Import Log", - "options": "JSON" - }, { "fieldname": "import_log_section", "fieldtype": "Section Break", @@ -198,11 +192,17 @@ { "fieldname": "column_break_4", "fieldtype": "Column Break" + }, + { + "fieldname": "statement_import_log", + "fieldtype": "Code", + "label": "Statement Import Log", + "options": "JSON" } ], "hide_toolbar": 1, "links": [], - "modified": "2021-05-12 14:17:37.777246", + "modified": "2022-09-07 11:11:40.293317", "modified_by": "Administrator", "module": "Accounts", "name": "Bank Statement Import",