Skip to content

T3047 fix theme dependent redirections#303

Merged
ecino merged 10 commits into14.0from
T3047-fix-theme-dependent-redirections
Mar 11, 2026
Merged

T3047 fix theme dependent redirections#303
ecino merged 10 commits into14.0from
T3047-fix-theme-dependent-redirections

Conversation

@NoeBerdoz
Copy link
Contributor

@NoeBerdoz NoeBerdoz commented Mar 10, 2026

Description

This PR resolves a multi-website routing issue where my_compassion controllers were globally intercepting core Odoo portal routes (/my, /web/login, /web/signup, '/my/information). This global interception was breaking the portal and login experience for users on other websites like Muskathlon and TOGETHER.

Changes Made

  • Isolated Redirects: Added strict website checks (request.env.ref("my_compassion.my2_website"))
  • Safe Fallbacks: Ensure that if the user is on Muskathlon or TOGETHER, the controllers safely fall back to super() method.
  • Preserved Routing: The ?redirect= parameter is handled as well.

Impact

MyCompassion users will continue to be seamlessly directed to the 2.0 dashboard (/my2/dashboard), while users on all other websites will now correctly see their native Odoo portal views without issues.

@NoeBerdoz
Copy link
Contributor Author

/gemini review

@NoeBerdoz
Copy link
Contributor Author

/gemini summary

@gemini-code-assist
Copy link
Contributor

Summary of Changes

This pull request addresses a critical multi-website routing issue where MyCompassion's custom controllers were globally intercepting core Odoo portal routes, disrupting the user experience on other websites. The changes ensure that MyCompassion users are seamlessly directed to their 2.0 dashboard, while users on all other websites correctly access their native Odoo portal views without interference.

Highlights

  • Isolated Redirects: Strict website checks were added to ensure that my_compassion controllers only intercept routes for the intended MyCompassion website.
  • Safe Fallbacks: Controllers now safely fall back to the super() method for other websites (like Muskathlon and TOGETHER), preventing unintended redirections.
  • Preserved Routing: The ?redirect= parameter is now correctly handled during redirections, maintaining user's intended destination.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Changelog
  • my_compassion/controllers/my2_auth_signup.py
    • Modified the web_auth_signup method to add a condition checking if the current request.website matches my_compassion.my2_website before redirecting logged-in users to /my2/dashboard/.
    • Updated the redirection to also consider a redirect parameter from kw.
  • my_compassion/controllers/my2_login.py
    • Modified the web_login method to add a condition checking if the current request.website matches my_compassion.my2_website before redirecting logged-in users to /my2/dashboard/.
    • Updated the redirection to also consider a redirect parameter from kw.
  • my_compassion/controllers/my_account.py
    • Added an import for datetime.
    • Modified the home method to include a website check (request.website == my_compassion.my2_website) before redirecting to /my2/dashboard. If the website does not match, it now calls super().home().
    • Modified the redirect_old_my_information method to include a website check before redirecting to /my2/user_settings. If the website does not match, it now renders the my_information_page_template and handles the privacy_policy acceptance by setting legal_agreement_date.
  • theme_compassion_2025/views/template_header.xml
    • Removed two blank lines within the XML structure, specifically between xpath elements.
Activity
  • NoeBerdoz requested a review on 2026-03-10 15:12:16 UTC.
  • NoeBerdoz requested a summary on 2026-03-10 15:14:03 UTC.

@ecino ecino merged commit 3ac6a4b into 14.0 Mar 11, 2026
1 check passed
@ecino ecino deleted the T3047-fix-theme-dependent-redirections branch March 11, 2026 06:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants