Skip to content

Commit 673d6b3

Browse files
dnplkndllgithub-actions[bot]
authored andcommitted
[OU-FIX] project_todo: clear 'to-do' action path before reload
1 parent 4187061 commit 673d6b3

1 file changed

Lines changed: 17 additions & 0 deletions

File tree

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+
"""Clear the 'to-do' action path before the module data reloads.
7+
8+
19.0 adds a unique ``ir.actions.path``. On a fresh install only the
9+
act_window ``project_task_action_todo`` owns 'to-do'; during migration the
10+
pre-existing server action also gets 'to-do' auto-populated, so when the
11+
window action's view data reloads it trips the cross-table uniqueness
12+
check. Null both here; the view data reload re-sets the window action.
13+
"""
14+
for table in ("ir_act_window", "ir_act_server"):
15+
openupgrade.logged_query(
16+
env.cr, f"UPDATE {table} SET path = NULL WHERE path = 'to-do'"
17+
)

0 commit comments

Comments
 (0)