From 7776b7f10db1a59f442c3e2f903882311979afb1 Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Wed, 26 Aug 2026 09:28:48 +0000 Subject: [PATCH 1/2] 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 --- odoo/addons/project_home_action/__init__.py | 2 ++ .../project_home_action/__manifest__.py | 19 ++++++++++++ odoo/addons/project_home_action/hooks.py | 13 ++++++++ .../project_home_action/models/__init__.py | 1 + .../project_home_action/models/res_users.py | 20 +++++++++++++ .../views/res_users_views.xml | 30 +++++++++++++++++++ 6 files changed, 85 insertions(+) create mode 100644 odoo/addons/project_home_action/__init__.py create mode 100644 odoo/addons/project_home_action/__manifest__.py create mode 100644 odoo/addons/project_home_action/hooks.py create mode 100644 odoo/addons/project_home_action/models/__init__.py create mode 100644 odoo/addons/project_home_action/models/res_users.py create mode 100644 odoo/addons/project_home_action/views/res_users_views.xml diff --git a/odoo/addons/project_home_action/__init__.py b/odoo/addons/project_home_action/__init__.py new file mode 100644 index 0000000..cc6b635 --- /dev/null +++ b/odoo/addons/project_home_action/__init__.py @@ -0,0 +1,2 @@ +from . import models +from .hooks import post_init_hook diff --git a/odoo/addons/project_home_action/__manifest__.py b/odoo/addons/project_home_action/__manifest__.py new file mode 100644 index 0000000..814c835 --- /dev/null +++ b/odoo/addons/project_home_action/__manifest__.py @@ -0,0 +1,19 @@ +{ + "name": "Project as Home Action", + "version": "1.0.0", + "summary": "Open Projects after login instead of Discuss", + "description": ( + "Restores the Home Action field on user Preferences (removed in Odoo 19) " + "and sets it to Projects for internal users on install and for new users." + ), + "category": "Project", + "author": "Automated", + "license": "LGPL-3", + "depends": ["base", "project", "web"], + "data": [ + "views/res_users_views.xml", + ], + "post_init_hook": "post_init_hook", + "installable": True, + "application": False, +} diff --git a/odoo/addons/project_home_action/hooks.py b/odoo/addons/project_home_action/hooks.py new file mode 100644 index 0000000..220ff8a --- /dev/null +++ b/odoo/addons/project_home_action/hooks.py @@ -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}) diff --git a/odoo/addons/project_home_action/models/__init__.py b/odoo/addons/project_home_action/models/__init__.py new file mode 100644 index 0000000..8835165 --- /dev/null +++ b/odoo/addons/project_home_action/models/__init__.py @@ -0,0 +1 @@ +from . import res_users diff --git a/odoo/addons/project_home_action/models/res_users.py b/odoo/addons/project_home_action/models/res_users.py new file mode 100644 index 0000000..90e34da --- /dev/null +++ b/odoo/addons/project_home_action/models/res_users.py @@ -0,0 +1,20 @@ +from odoo import api, models + + +class ResUsers(models.Model): + _inherit = "res.users" + + @api.model + def _project_home_action(self): + return self.env.ref("project.open_view_project_all", raise_if_not_found=False) + + @api.model_create_multi + def create(self, vals_list): + users = super().create(vals_list) + action = self._project_home_action() + if not action: + return users + to_update = users.filtered(lambda user: not user.share and not user.action_id) + if to_update: + to_update.write({"action_id": action.id}) + return users diff --git a/odoo/addons/project_home_action/views/res_users_views.xml b/odoo/addons/project_home_action/views/res_users_views.xml new file mode 100644 index 0000000..be3377f --- /dev/null +++ b/odoo/addons/project_home_action/views/res_users_views.xml @@ -0,0 +1,30 @@ + + + + + res.users.form.home.action + res.users + + + + + + + + + + + + + res.users.preferences.form.home.action + res.users + + + + + + + + + + From 19db9c58dd3964d5f28e8391bbf6987674ff8952 Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Wed, 26 Aug 2026 09:38:28 +0000 Subject: [PATCH 2/2] Document how to install project_home_action in README Add Odoo startup-page steps under the existing Odoo section so operators know how to enable Projects as the post-login landing. Co-authored-by: dyaco8464 --- README.md | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/README.md b/README.md index 24e0d85..cebf06b 100644 --- a/README.md +++ b/README.md @@ -422,6 +422,25 @@ done This ensures Odoo can create attachments, logs, and configuration files without permission errors. +#### Odoo startup page (Projects instead of Discuss) + +By default, Odoo 19 opens **Discuss** after login. The custom addon [`odoo/addons/project_home_action`](odoo/addons/project_home_action) restores the **Home Action** field on user Preferences and sets it to **Projects** for internal users. + +`./odoo/addons` is already mounted into the container at `/mnt/extra-addons` via [`odoo/odoo.yml`](odoo/odoo.yml). After deploying a revision that includes this addon: + +1. Restart Odoo if the container was already running, so it picks up the new module files: + ```bash + docker compose restart odoo + ``` +2. In Odoo, open **Settings → Apps**. +3. Remove the **Apps** filter (and enable **developer mode** if the Apps menu is limited), then **Update Apps List**. +4. Search for **Project as Home Action** (`project_home_action`) and **Install** it. +5. Log out and log back in. You should land on Projects (`/odoo/project`) instead of Discuss. + +On install, existing internal users with an empty Home Action are updated automatically. New internal users get the same default. You can still change Home Action per user under **Settings → Users → Preferences** (or **My Preferences**). + +Requires the **Project** app to be installed (`depends: project`). + ### Compose File Structure This repository uses a modular approach with multiple compose files: