Skip to content

Commit

Permalink
fix: guard against undeclared columns
Browse files Browse the repository at this point in the history
  • Loading branch information
blaggacao committed Oct 1, 2024
1 parent 05d0fd1 commit 4b15e69
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions erpnext/edi/doctype/code_list/code_list_import.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,12 @@ def get_columns_and_examples(file_path):
for row in root.findall(".//SimpleCodeList/Row"):
for value in row.findall("Value"):
column_id = value.get("ColumnRef")
if column_id not in columns:
# Handle undeclared column
columns.append(column_id)
example_values[column_id] = []
filterable_columns[column_id] = set()

value_text = value.find("./SimpleValue").text
filterable_columns[column_id].add(value_text)

Expand Down

0 comments on commit 4b15e69

Please sign in to comment.