Skip to content

Commit 1d5f193

Browse files
committed
[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.
1 parent 0da208c commit 1d5f193

2 files changed

Lines changed: 18 additions & 1 deletion

File tree

docsource/modules180-190.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -956,7 +956,7 @@ Module coverage 18.0 -> 19.0
956956
+---------------------------------------------------+----------------------+-------------------------------------------------+
957957
| project_timesheet_holidays | | |
958958
+---------------------------------------------------+----------------------+-------------------------------------------------+
959-
| project_todo | | |
959+
| project_todo |Done | |
960960
+---------------------------------------------------+----------------------+-------------------------------------------------+
961961
| purchase |Done | |
962962
+---------------------------------------------------+----------------------+-------------------------------------------------+
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
from openupgradelib import openupgrade
2+
3+
4+
@openupgrade.migrate()
5+
def migrate(env, version):
6+
"""Null ``path`` on the todo action, as the schema upgrade pre-populates
7+
it and the module data XML then trips the unique constraint on its own
8+
row.
9+
"""
10+
openupgrade.logged_query(
11+
env.cr,
12+
"""
13+
UPDATE ir_act_window
14+
SET path = NULL
15+
WHERE path = 'to-do'
16+
""",
17+
)

0 commit comments

Comments
 (0)