diff --git a/erpnext/accounts/doctype/bank_statement_import_log/bank_statement_import_log.py b/erpnext/accounts/doctype/bank_statement_import_log/bank_statement_import_log.py index f50549befa1..783ebf23870 100644 --- a/erpnext/accounts/doctype/bank_statement_import_log/bank_statement_import_log.py +++ b/erpnext/accounts/doctype/bank_statement_import_log/bank_statement_import_log.py @@ -1183,8 +1183,7 @@ def update_pdf_tables(statement_import_id: str, tables: list | str): if doc.status == "Completed": frappe.throw(_("This statement has already been imported."), title=_("Already Imported")) - if isinstance(tables, str): - tables = json.loads(tables) + tables = frappe.parse_json(tables) doc.apply_pdf_tables(tables) @@ -1204,8 +1203,7 @@ def reextract_pdf_table(statement_import_id: str, page: int, table_index: int, b if doc.status == "Completed": frappe.throw(_("This statement has already been imported."), title=_("Already Imported")) - if isinstance(bbox, str): - bbox = json.loads(bbox) + bbox = frappe.parse_json(bbox) page = int(page) table_index = int(table_index) @@ -1290,8 +1288,7 @@ def update_column_mapping(statement_import_id: str, column_mapping: list | str): if doc.status == "Completed": frappe.throw(_("This statement has already been imported."), title=_("Already Imported")) - if isinstance(column_mapping, str): - column_mapping = json.loads(column_mapping) + column_mapping = frappe.parse_json(column_mapping) doc.apply_column_mapping(column_mapping) doc.save()