From 522e2cfba99ad874c7a8f5b805d85ba6d2a3b592 Mon Sep 17 00:00:00 2001
From: metatroncubeswdev
Date: Sun, 27 Sep 2026 13:42:20 -0400
Subject: [PATCH] Fix broken and placeholder links across the TNCSC website
Page templates (views/website_pages.xml):
- Footer social icons pointed at facebook.com/youtube.com/instagram.com
homepages; now TNCSC's own profiles.
- "View Event" pointed at a static product mock-up; now /event.
- Home "Book Now", Events "Register Event" and the picnic page's
"Add To Cart" (which went to /contact) now open the real Summer Picnic
registration, falling back to /event if that event is missing.
- Home All/Event tabs were href="#"; now /event.
- About "Learn More" went to the contact form; relabelled "Contact Us".
- Benefits "Become A Member" now goes to /membership/registration.
Stock Odoo chrome on built-in pages (login, event/school registration):
- Footer replaced with a TNCSC footer (real links, company email, only
configured social profiles) instead of demo content with
info@yourcompany.example.com, a 555 number and dead "#" links. Priority
90 so it also wins over the website-specific footer copy on the server.
- Header "Contact Us" now goes to /contact; the demo phone number is
replaced by the company email.
community_portal: /my and /my/home (the "Member Login" target) returned a
500 for anonymous visitors because of this Odoo build's auth='user'
redirect bug; they now redirect to the login page.
website_pages.xml is noupdate, so upgrades never applied template fixes.
The 19.0.1.2.0 pre-migrate reloads it once in init mode (this overwrites
website-editor edits to those pages; none exist on the server).
Verified locally: upgrade of tncsc_site succeeds, every internal link on
16 pages resolves (200/30x), and a fresh install passes 34/34 tests for
community_membership, community_portal and tncsc_deployment.
Co-Authored-By: Claude Opus 5.5
---
addons/community_portal/controllers/portal.py | 10 ++
addons/tncsc_deployment/__manifest__.py | 2 +-
.../migrations/19.0.1.2.0/pre-migrate.py | 18 +++
.../views/website_header_overrides.xml | 79 +++++++++++++
.../tncsc_deployment/views/website_pages.xml | 110 +++++++++---------
5 files changed, 165 insertions(+), 54 deletions(-)
create mode 100644 addons/tncsc_deployment/migrations/19.0.1.2.0/pre-migrate.py
diff --git a/addons/community_portal/controllers/portal.py b/addons/community_portal/controllers/portal.py
index 23bb14f..452b0e6 100644
--- a/addons/community_portal/controllers/portal.py
+++ b/addons/community_portal/controllers/portal.py
@@ -48,6 +48,16 @@ class CommunityPortalDashboard(CustomerPortal):
return values
+ @http.route(['/my', '/my/home'], type='http', auth='public', website=True)
+ def home(self, **kw):
+ # Core declares these auth='user', which on this Odoo build returns a
+ # 500 for anonymous visitors instead of redirecting to login (see
+ # community_classifieds' _redirect_to_login_if_public). "Member Login"
+ # links point here, so check auth ourselves.
+ if request.env.user._is_public():
+ return request.redirect('/web/login?redirect=/my')
+ return super().home(**kw)
+
@http.route(['/my/school'], type='http', auth='public', website=True)
def portal_my_school(self, **kwargs):
if request.env.user._is_public():
diff --git a/addons/tncsc_deployment/__manifest__.py b/addons/tncsc_deployment/__manifest__.py
index ac01fec..a62e4f9 100644
--- a/addons/tncsc_deployment/__manifest__.py
+++ b/addons/tncsc_deployment/__manifest__.py
@@ -1,6 +1,6 @@
{
'name': 'TNCSC Deployment',
- 'version': '19.0.1.1.0',
+ 'version': '19.0.1.2.0',
'category': 'Hidden',
'summary': 'Tamil Nadu Cultural Society of Canada - client configuration for the Community OS suite',
'description': """
diff --git a/addons/tncsc_deployment/migrations/19.0.1.2.0/pre-migrate.py b/addons/tncsc_deployment/migrations/19.0.1.2.0/pre-migrate.py
new file mode 100644
index 0000000..61fb7b4
--- /dev/null
+++ b/addons/tncsc_deployment/migrations/19.0.1.2.0/pre-migrate.py
@@ -0,0 +1,18 @@
+"""Reload the seeded website pages from views/website_pages.xml.
+
+That file is noupdate="1" so edits made in the website editor survive
+upgrades, but it also means upgrades never deliver template fixes (here:
+broken and placeholder links). Loading it once in 'init' mode rewrites the
+existing page views. Any website-editor changes to these pages are
+overwritten by this upgrade.
+
+Runs before the module's data is loaded so the header overrides in
+views/website_header_overrides.xml are validated against current pages.
+"""
+from odoo import SUPERUSER_ID, api
+from odoo.tools import convert_file
+
+
+def migrate(cr, version):
+ env = api.Environment(cr, SUPERUSER_ID, {})
+ convert_file(env, 'tncsc_deployment', 'views/website_pages.xml', {}, mode='init', noupdate=True)
diff --git a/addons/tncsc_deployment/views/website_header_overrides.xml b/addons/tncsc_deployment/views/website_header_overrides.xml
index e8315a5..cd05db0 100644
--- a/addons/tncsc_deployment/views/website_header_overrides.xml
+++ b/addons/tncsc_deployment/views/website_header_overrides.xml
@@ -129,5 +129,84 @@
+
+
+
+
+
+
diff --git a/addons/tncsc_deployment/views/website_pages.xml b/addons/tncsc_deployment/views/website_pages.xml
index e61dff0..86b4c57 100644
--- a/addons/tncsc_deployment/views/website_pages.xml
+++ b/addons/tncsc_deployment/views/website_pages.xml
@@ -356,7 +356,7 @@
Tamil Class
Contact
-
+
View Event
@@ -431,7 +431,8 @@
Unity & Pride
@@ -652,14 +653,14 @@
@@ -725,7 +726,8 @@
@@ -836,13 +838,13 @@
@@ -1168,7 +1170,7 @@
Tamil Class
Contact
-
+
View Event
@@ -1226,7 +1228,7 @@
@@ -1342,13 +1344,13 @@
@@ -1655,7 +1657,7 @@
Tamil Class
Contact
-
+
View Event
@@ -1759,13 +1761,13 @@
@@ -2105,7 +2107,7 @@
Tamil Class
Contact
-
+
View Event
@@ -2202,13 +2204,13 @@
@@ -2540,7 +2542,7 @@
Tamil Class
Contact
-
+
View Event
@@ -2618,13 +2620,13 @@
@@ -2948,7 +2950,7 @@
Tamil Class
Contact
-
+
View Event
@@ -3062,7 +3064,7 @@
@@ -3096,13 +3098,13 @@
@@ -3464,7 +3466,7 @@
Tamil Class
Contact
-
+
View Event
@@ -3651,13 +3653,13 @@
@@ -3996,7 +3998,7 @@
Tamil Class
Contact
-
+
View Event
@@ -4033,7 +4035,8 @@
$0.00 – $30.00
@@ -4070,13 +4073,13 @@
@@ -4348,7 +4351,7 @@
Contact
@@ -4460,8 +4463,9 @@
@@ -4496,13 +4500,13 @@
@@ -4803,7 +4807,7 @@
Tamil Class
Contact
-
+
View Event
@@ -4956,13 +4960,13 @@
@@ -5319,7 +5323,7 @@
Tamil Class
Contact
-
+
View Event
@@ -5464,13 +5468,13 @@