Files
selfhost-cloud-compose-stack/odoo/addons/project_home_action/hooks.py
Cursor Agent 7776b7f10d Add project_home_action addon for Project login landing
Restores Home Action on user Preferences (removed in Odoo 19) and
defaults internal users to project.open_view_project_all on install
and create, so login opens Projects instead of Discuss.

Co-authored-by: dyaco8464 <dyaco8464@yahoo.com>
2026-08-26 09:28:48 +00:00

14 lines
409 B
Python

def post_init_hook(env):
"""Set Home Action to Projects for internal users that have none."""
action = env.ref("project.open_view_project_all", raise_if_not_found=False)
if not action:
return
users = env["res.users"].search(
[
("share", "=", False),
("action_id", "=", False),
]
)
if users:
users.write({"action_id": action.id})