From 8cb2a771229b1313207aff26305f60b68373b2e4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miquel=20Ra=C3=AFch?= Date: Thu, 12 Dec 2024 13:06:11 +0100 Subject: [PATCH] [FIX] upgrade_analysis: migration errors --- upgrade_analysis/compare.py | 9 +++++---- upgrade_analysis/upgrade_log.py | 2 +- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/upgrade_analysis/compare.py b/upgrade_analysis/compare.py index f4c251566dd..7024cc59044 100644 --- a/upgrade_analysis/compare.py +++ b/upgrade_analysis/compare.py @@ -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 = "" @@ -491,7 +492,7 @@ def compare_model_sets(old_records, new_records): f" (renamed to {model_map(model)}{moved_module})" ) if column["model_type"]: - text += " [column['model_type']]" + text += f" [{column['model_type']}]" reprs[module_map(column["module"])].append(text) reprs["general"].append( f"obsolete model {model} (renamed to {model_map(model)}) " @@ -501,11 +502,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']}]" 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']}]" for column in copy.copy(new_records): model = column["model"] diff --git a/upgrade_analysis/upgrade_log.py b/upgrade_analysis/upgrade_log.py index a0df0dc62d4..687072771b6 100644 --- a/upgrade_analysis/upgrade_log.py +++ b/upgrade_analysis/upgrade_log.py @@ -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()