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>
14 lines
409 B
Python
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})
|