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 <noreply@anthropic.com>
19 lines
772 B
Python
19 lines
772 B
Python
"""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)
|