From e16533c84bb3764432a272c998b73d30445c75ac Mon Sep 17 00:00:00 2001 From: David Date: Tue, 1 Oct 2024 14:01:19 +0200 Subject: [PATCH] chore: pass already parsed root --- erpnext/edi/doctype/code_list/code_list_import.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/erpnext/edi/doctype/code_list/code_list_import.py b/erpnext/edi/doctype/code_list/code_list_import.py index 2e71756ec4974..14760a84c8eda 100644 --- a/erpnext/edi/doctype/code_list/code_list_import.py +++ b/erpnext/edi/doctype/code_list/code_list_import.py @@ -43,7 +43,7 @@ def import_genericode(): file_path = file_doc.get_full_path() # Get available columns and example values - columns, example_values, filterable_columns = get_columns_and_examples(file_path) + columns, example_values, filterable_columns = get_genericode_columns_and_examples(root) return { "code_list": code_list.name, @@ -64,11 +64,7 @@ def process_genericode_import( ) -def get_columns_and_examples(file_path): - parser = etree.XMLParser(remove_blank_text=True) - tree = etree.parse(file_path, parser=parser) - root = tree.getroot() - +def get_genericode_columns_and_examples(root): columns = [] example_values = {} filterable_columns = {}