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>
This commit is contained in:
13
odoo/addons/project_home_action/hooks.py
Normal file
13
odoo/addons/project_home_action/hooks.py
Normal file
@@ -0,0 +1,13 @@
|
||||
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})
|
||||
Reference in New Issue
Block a user