Skip to content

Commit

Permalink
[FIX] upgrade_analysis: migration errors
Browse files Browse the repository at this point in the history
  • Loading branch information
MiquelRForgeFlow committed Dec 13, 2024
1 parent 855b13c commit 3a4fbdd
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
9 changes: 5 additions & 4 deletions upgrade_analysis/compare.py
Original file line number Diff line number Diff line change
Expand Up @@ -480,7 +480,8 @@ def compare_model_sets(old_records, new_records):
text += f" [{column['model_type']}]"
reprs[module_map(column["module"])].append(text)
reprs["general"].append(
f"obsolete model {model} [module module_map(column['module'])]"
f"obsolete model {model} "
f"[module {module_map(column['module'])}]"
)
else:
moved_module = ""
Expand All @@ -492,7 +493,7 @@ def compare_model_sets(old_records, new_records):
moved_module,
)
if column["model_type"]:
text += " [column['model_type']]"
text += f" [{column['model_type']}]"

Check warning on line 496 in upgrade_analysis/compare.py

View check run for this annotation

Codecov / codecov/patch

upgrade_analysis/compare.py#L496

Added line #L496 was not covered by tests
reprs[module_map(column["module"])].append(text)
reprs["general"].append(
f"obsolete model {model} (renamed to {model_map(model)}) "
Expand All @@ -502,11 +503,11 @@ def compare_model_sets(old_records, new_records):
if module_map(column["module"]) != new_models[model]:
text = f"model {model} (moved to {new_models[model]})"
if column["model_type"]:
text += " [column['model_type']]"
text += f" [{column['model_type']}]"

Check warning on line 506 in upgrade_analysis/compare.py

View check run for this annotation

Codecov / codecov/patch

upgrade_analysis/compare.py#L506

Added line #L506 was not covered by tests
reprs[module_map(column["module"])].append(text)
text = f"model {model} (moved from {old_models[model]})"
if column["model_type"]:
text += " [column['model_type']]"
text += f" [{column['model_type']}]"

Check warning on line 510 in upgrade_analysis/compare.py

View check run for this annotation

Codecov / codecov/patch

upgrade_analysis/compare.py#L510

Added line #L510 was not covered by tests

for column in copy.copy(new_records):
model = column["model"]
Expand Down
2 changes: 1 addition & 1 deletion upgrade_analysis/upgrade_log.py
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ def log_xml_id(cr, module, xml_id):
if "." not in xml_id:
xml_id = f"{module}.{xml_id}"
cr.execute(
"SELECT model FROM ir_model_data " "WHERE module = %s AND name = %s",
"SELECT model FROM ir_model_data WHERE module = %s AND name = %s",
xml_id.split("."),
)
record = cr.fetchone()
Expand Down

0 comments on commit 3a4fbdd

Please sign in to comment.