Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,6 @@ def write(self, projects: Sequence[Project]):
variance = abs(v2 - v1)
except TypeError:
pass

data_row.extend([v1, v2, variance])

self.sheet.append(data_row)
Expand Down
2 changes: 1 addition & 1 deletion core/api/export/single_project_v2/xlsx_headers.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ def get_headers_specific_information(fields: Iterable[ProjectField]):
header["type"] = "bool"
elif field_type == "number":
header["type"] = "int"
elif field_type == "decimal":
elif field_type in ["decimal", "decimal-money"]:
header["type"] = "number"
header["align"] = "right"

Expand Down
15 changes: 9 additions & 6 deletions core/import_data/import_project_resources_v2.py
Original file line number Diff line number Diff line change
Expand Up @@ -415,9 +415,9 @@ def _clean_up_field_name(field_name, mya=False):
if field_name in FIELDS_WITH_ACTUAL_VALUES
]
field_names_excluding_mya.extend(actual_field_names)
project_fields = ProjectField.objects.exclude(section="MYA").filter(
import_name__in=field_names_excluding_mya
)
project_fields = ProjectField.objects.exclude(
section__in=["MYA", "N/A"]
).filter(import_name__in=field_names_excluding_mya)

missing_fields = set(field_names_excluding_mya) - set(
project_fields.values_list("import_name", flat=True)
Expand All @@ -436,9 +436,10 @@ def _clean_up_field_name(field_name, mya=False):
if row[field_index] != ""
]
project_fields = ProjectField.objects.filter(
import_name__in=mya_field_names, section="MYA"
import_name__in=mya_field_names, section__in=["MYA", "N/A"]
)
missing_fields = set(mya_field_names) - set(

missing_fields = set(missing_fields) - set(
project_fields.values_list("import_name", flat=True)
)
for missing_field in missing_fields:
Expand Down Expand Up @@ -608,7 +609,9 @@ def import_fields(file_path):
}

ProjectField.objects.update_or_create(
import_name=field_data["import_name"], defaults=field_data
import_name=field_data["import_name"],
table=field_data["table"],
defaults=field_data,
)


Expand Down
Loading
Loading