Skip to content

[16.0][ADD] project_update_portal: add new module#1599

Merged
OCA-git-bot merged 1 commit intoOCA:16.0from
Escodoo:16.0-add-project_update_portal
Mar 3, 2026
Merged

[16.0][ADD] project_update_portal: add new module#1599
OCA-git-bot merged 1 commit intoOCA:16.0from
Escodoo:16.0-add-project_update_portal

Conversation

@marcelsavegnago
Copy link
Copy Markdown
Member

@marcelsavegnago marcelsavegnago commented Nov 12, 2025

This module extends project updates functionality by allowing portal access for project and update followers.

Main Features

  • Portal Access for Followers: Allows project followers and update followers to access project updates through the portal
  • Automatic Access Control: Automatically grants access based on follower relationships
  • Update List View: Portal users can view all updates for projects they follow
  • Update Detail View: Portal users can view detailed information about specific updates
  • Breadcrumb Navigation: Integrated breadcrumb navigation for easy access to updates

Benefits

  • Keep stakeholders informed about project progress without requiring full system access
  • Share project updates with external partners and clients through the portal
  • Maintain transparency by allowing followers to track project status
  • Easy access to project updates through a dedicated portal interface

Dependencies

This module requires:

  • project: Odoo's project management module
  • portal: Odoo's portal module for customer access

cc @parzewski @kaynnan

@marcelsavegnago marcelsavegnago marked this pull request as draft November 12, 2025 04:34
@marcelsavegnago marcelsavegnago force-pushed the 16.0-add-project_update_portal branch 4 times, most recently from c0502ea to 717f064 Compare November 12, 2025 04:57
@marcelsavegnago marcelsavegnago marked this pull request as ready for review November 12, 2025 05:17
@marcelsavegnago marcelsavegnago force-pushed the 16.0-add-project_update_portal branch 2 times, most recently from bd53c11 to 575873d Compare November 14, 2025 20:15
@marcelsavegnago marcelsavegnago changed the title [WIP][16.0][ADD] project_update_portal: add new module [16.0][ADD] project_update_portal: add new module Nov 14, 2025
Copy link
Copy Markdown
Member

@CristianoMafraJunior CristianoMafraJunior left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Copy Markdown

@WesleyOliveira98 WesleyOliveira98 left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Copy Markdown
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.

Thanks for the contribution -- exposing project updates in the portal is a genuinely useful feature. The module structure, tests, and documentation are solid overall. However, there are a few security and correctness issues to address.

Security: auth="public" on detail route is too permissive. The detail route uses auth="public" while the list route uses auth="user". Unauthenticated visitors can probe the detail endpoint, and redirect behavior leaks whether a project ID exists. Both routes should be consistent.

Security: single access_token validates two different records. The same token is used to check access to project.project and project.update. Portal tokens are record-specific -- a token for one won't pass _document_check_access for the other. For portal followers this is bypassed via ir.rule, but for token-based flows both checks will fail.

Correctness: unnecessary @api.depends. _compute_access_url depends on message_partner_ids but only uses project_id and id. Adding/removing followers would trigger needless recomputation.

Accessibility: aria-valuenow in list template. The progress bar has literal string "update.progress" instead of the actual value via t-attf-aria-valuenow.

Happy to re-review once updated.

["/my/projects/<int:project_id>/update/<int:update_id>"],
type="http",
auth="public",
website=True,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This route uses auth="public" while the list route at line 57 uses auth="user". This inconsistency means unauthenticated users can probe this endpoint. The redirect behavior (/my vs /my/projects/<id>) leaks whether a given project_id exists. Change to auth="user" for consistency.

"""Route to view a specific project update"""
try:
# Check project access first
self._document_check_access("project.project", project_id, access_token)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The same access_token is used to validate both the project and the update. Portal access tokens are record-specific -- a token for project.update won't pass _document_check_access for project.project and vice versa.

Consider either removing the project access check here (the update->project_id integrity check is sufficient after validating the update), or checking project access without the token.

class ProjectUpdate(models.Model):
_name = "project.update"
_inherit = ["project.update", "portal.mixin"]

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

message_partner_ids in @api.depends but never used in the method body. Remove to avoid needless recomputation on follower changes:

Suggested change
@api.depends("project_id")

role="progressbar"
aria-valuenow="update.progress"
aria-valuemin="0"
aria-valuemax="100"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

aria-valuenow is a literal string "update.progress" instead of the actual value. Should be t-attf-aria-valuenow="{{ update.progress }}" to match the detail view template.

@CristianoMafraJunior CristianoMafraJunior force-pushed the 16.0-add-project_update_portal branch from 575873d to f243459 Compare March 2, 2026 17:47
@CristianoMafraJunior
Copy link
Copy Markdown
Member

@alexey-pelykh The corrections from your review have been made. Could you please check again?

@OCA-git-bot
Copy link
Copy Markdown
Contributor

This PR has the approved label and has been created more than 5 days ago. It should therefore be ready to merge by a maintainer (or a PSC member if the concerned addon has no declared maintainer). 🤖

Copy link
Copy Markdown
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.

All four items from the previous review have been addressed:

  1. Detail route now uses auth="user", consistent with the list route.
  2. Project access check no longer passes the access_token -- token is only used for the update record, project access relies on ir.rule. Correct separation.
  3. @api.depends reduced to ("project_id") only.
  4. aria-valuenow uses t-attf-aria-valuenow with the actual value in both list and detail templates.

Looks good, thank you for the quick turnaround.

@leemannd
Copy link
Copy Markdown
Contributor

leemannd commented Mar 3, 2026

/ocabot merge nobump

@OCA-git-bot
Copy link
Copy Markdown
Contributor

What a great day to merge this nice PR. Let's do it!
Prepared branch 16.0-ocabot-merge-pr-1599-by-leemannd-bump-nobump, awaiting test results.

@OCA-git-bot OCA-git-bot merged commit e8da81a into OCA:16.0 Mar 3, 2026
7 checks passed
@OCA-git-bot
Copy link
Copy Markdown
Contributor

Congratulations, your PR was merged at aef77c9. Thanks a lot for contributing to OCA. ❤️

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants