Skip to content

[16.0][FIX] project_timeline: Prevent at uninstall the error "No default view of type 'timeline'"#1677

Open
arnaudlayec wants to merge 7 commits intoOCA:16.0from
arnaudlayec:16.0-fix-project-timeline
Open

[16.0][FIX] project_timeline: Prevent at uninstall the error "No default view of type 'timeline'"#1677
arnaudlayec wants to merge 7 commits intoOCA:16.0from
arnaudlayec:16.0-fix-project-timeline

Conversation

@arnaudlayec
Copy link

@arnaudlayec arnaudlayec commented Feb 24, 2026

Before
When uninstalling the module, specific timeline views are well removed.
But not the attribute view_mode of ir_act_window model.
This causes the UserError from base ir_ui_view model to raise when the user browse to the Project menu, blocking all browsing into Project apps. The error is : "No default view of type 'timeline' could be found !"

Fix proposal
This module adds an uninstall_hook which trims the string timeline from the "view_mode" attributes of ir.actions.act_window model.

If approved, I will forward-port to 18.0.

@arnaudlayec arnaudlayec changed the title [16.0][FIX] Prevent at uninstall the error "No default view of type 'timeline'" [16.0][FIX] project_timeline: Prevent at uninstall the error "No default view of type 'timeline'" Feb 24, 2026
@arnaudlayec arnaudlayec force-pushed the 16.0-fix-project-timeline branch from 7317a3c to d577607 Compare February 24, 2026 11:33
Copy link

@luisDIXMIT luisDIXMIT left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code review, LGTM!

Copy link
Contributor

@alexey-pelykh alexey-pelykh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good fix. The uninstall hook properly cleans up the timeline view mode from affected actions, preventing the "No default view of type 'timeline'" error after uninstalling. Clean implementation. LGTM.

Copy link
Contributor

@alexey-pelykh alexey-pelykh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Follow-up review with a couple of robustness observations on the uninstall hook.

Overall the approach is sound -- cleaning view_mode during uninstall is the right fix for the "No default view of type 'timeline'" error. Two edge cases worth considering:

  1. ValueError if remove() finds no match: The domain uses ilike, which is case-insensitive. If an action's view_mode somehow contains Timeline (capitalized) or a substring match like timeline2, the ilike filter would match it, but view_mode.remove("timeline") would raise ValueError because the exact string "timeline" is not in the split list. A safer pattern would be a list comprehension filter:

    view_mode = [m for m in action.view_mode.split(",") if m.strip() != "timeline"]
  2. Empty view_mode after removal: If an action has view_mode = "timeline" as its only view mode, after removal the result would be an empty string. Odoo expects at least one view mode in ir.actions.act_window. Consider either skipping such actions or setting a fallback (e.g., "tree,form").

Neither of these is likely to occur in practice with the standard project_timeline module, so they are minor robustness improvements rather than blockers. The existing approval stands.

Review posted via CorporateHub OCA review campaign

sebastienbeau and others added 7 commits March 2, 2026 10:40
Currently translated at 100.0% (3 of 3 strings)

Translation: project-16.0/project-16.0-project_reviewer
Translate-URL: https://translation.odoo-community.org/projects/project-16-0/project-16-0-project_reviewer/it/
…ne'"

By adding an `uninstall_hook` which trims "timeline" from the "view_mode" attributes of "ir_act_window" model

to merge with previous

to merge with previous
@arnaudlayec arnaudlayec force-pushed the 16.0-fix-project-timeline branch from d577607 to c286c9d Compare March 2, 2026 09:41
Copy link
Contributor

@alexey-pelykh alexey-pelykh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixes look good. The list comprehension with .lower() handles edge cases cleanly, and removing the action + menu when view_mode becomes empty is a better approach than a fallback -- an action that only served the timeline view has no purpose post-uninstall. Tests cover both cases (multi-mode trim and single-mode cleanup) and the demo data independence improvement is a welcome bonus.

Review posted via CorporateHub OCA review campaign

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants