Skip to content

Commit

Permalink
chore: pass already parsed root
Browse files Browse the repository at this point in the history
  • Loading branch information
blaggacao committed Oct 1, 2024
1 parent 46ab6ef commit e16533c
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions erpnext/edi/doctype/code_list/code_list_import.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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 = {}
Expand Down

0 comments on commit e16533c

Please sign in to comment.