From 50c86fb93bcdc882197b5120e8a41cfe63dbb220 Mon Sep 17 00:00:00 2001 From: Don Kendall Date: Thu, 21 May 2026 19:47:42 -0400 Subject: [PATCH] [OU-FIX] project_todo: pre-migrate path collision on ir.actions.act_window 19.0 adds the `path` column on `ir.actions.act_window` with a unique constraint and the schema upgrade pre-populates `path='to-do'` on `project_todo.project_task_action_todo`. When the module's data XML then `_load_records()` re-writes the same row with `path='to-do'`, the @api.constrains check finds the record's own existing value as a duplicate of itself and raises `Path to show in the URL must be unique`, aborting the migration at `project_todo/views/project_task_views.xml:277`. Null the column in pre-migration so the install path can re-set it cleanly. --- docsource/modules180-190.rst | 2 +- .../project_todo/19.0.1.0/pre-migration.py | 17 +++++++++++++++++ 2 files changed, 18 insertions(+), 1 deletion(-) create mode 100644 openupgrade_scripts/scripts/project_todo/19.0.1.0/pre-migration.py diff --git a/docsource/modules180-190.rst b/docsource/modules180-190.rst index e7f797ce0766..da1d6692df19 100644 --- a/docsource/modules180-190.rst +++ b/docsource/modules180-190.rst @@ -956,7 +956,7 @@ Module coverage 18.0 -> 19.0 +---------------------------------------------------+----------------------+-------------------------------------------------+ | project_timesheet_holidays | | | +---------------------------------------------------+----------------------+-------------------------------------------------+ -| project_todo | | | +| project_todo |Done | | +---------------------------------------------------+----------------------+-------------------------------------------------+ | purchase |Done | | +---------------------------------------------------+----------------------+-------------------------------------------------+ diff --git a/openupgrade_scripts/scripts/project_todo/19.0.1.0/pre-migration.py b/openupgrade_scripts/scripts/project_todo/19.0.1.0/pre-migration.py new file mode 100644 index 000000000000..9b3255f9c1e0 --- /dev/null +++ b/openupgrade_scripts/scripts/project_todo/19.0.1.0/pre-migration.py @@ -0,0 +1,17 @@ +from openupgradelib import openupgrade + + +@openupgrade.migrate() +def migrate(env, version): + """Null ``path`` on the todo action, as the schema upgrade pre-populates + it and the module data XML then trips the unique constraint on its own + row. + """ + openupgrade.logged_query( + env.cr, + """ + UPDATE ir_act_window + SET path = NULL + WHERE path = 'to-do' + """, + )