From 523a5d0a496b0880046f761ef56ad4a73c3796df Mon Sep 17 00:00:00 2001 From: Srujan N Date: Tue, 23 Sep 2025 01:23:19 +0000 Subject: [PATCH] fix: add missing whitelist decorator to convert_mt940_to_csv function The convert_mt940_to_csv function is called from the frontend JavaScript code but was missing the @frappe.whitelist() decorator, causing a "Method Not Allowed" error when users try to import MT940 files. This fix ensures the function is properly exposed as a public API endpoint while maintaining the security improvements from the previous commit that removed unnecessary whitelist from internal helper functions. --- .../doctype/bank_statement_import/bank_statement_import.py | 1 + 1 file changed, 1 insertion(+) diff --git a/erpnext/accounts/doctype/bank_statement_import/bank_statement_import.py b/erpnext/accounts/doctype/bank_statement_import/bank_statement_import.py index f7380afc961..bd5319d7c4d 100644 --- a/erpnext/accounts/doctype/bank_statement_import/bank_statement_import.py +++ b/erpnext/accounts/doctype/bank_statement_import/bank_statement_import.py @@ -142,6 +142,7 @@ def preprocess_mt940_content(content: str) -> str: return processed_content +@frappe.whitelist() def convert_mt940_to_csv(data_import, mt940_file_path): doc = frappe.get_doc("Bank Statement Import", data_import)