TNCSC_Odoo/HANDOFF-2026-09-28.md
metatroncubeswdev f8fc4edcb7
Some checks failed
CI / Brand-leak check (push) Has been cancelled
CI / flake8 / pylint-odoo / manifest completeness (push) Has been cancelled
CI / Install all modules with --test-enable (push) Has been cancelled
Remove db_name from odoo.conf and add the 28 Sep handoff
db_name = TNCSC (added in 0f462ad) made Odoo create a new empty TNCSC
database on the server and hide the existing metatrontncsc database,
because db_name both auto-creates a missing database and restricts
which databases are listed and served. Local dev shares this file, so
the line would do the same on every developer's machine.

Also adds HANDOFF-2026-09-28.md (this round's work, deploy steps,
pending work and decisions), links it from HANDOFF.md, and commits
docs/website-link-audit.md.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-28 10:58:48 -04:00

131 lines
12 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# Handoff: 28 September 2026
Covers the work done on 27–28 September 2026: the member application fields, the six real TNCSC membership plans, and the website link fixes. For phases 0–9 and general setup, read [HANDOFF.md](HANDOFF.md) first.
## Where things stand
| | |
|---|---|
| Repo | `https://git.metatroncube.in/admin/TNCSC_Odoo.git`, branch `main` |
| Commits this round | `657792b` (member fields and plans), `522e2cf` (link fixes) |
| Server | `https://tncsc.odoo.thedomainnest.com`, database `metatrontncsc`, Odoo 19.0 |
| Deployed | Yes. Both commits are live and upgraded (checked 28 Sep 2026). |
| Module versions on server | `community_membership` 19.0.1.1.0, `tncsc_deployment` 19.0.1.2.0 |
| Local dev | `deploy/` Docker stack on port **10004**, database `tncsc_site` |
## What was shipped
### `657792b`: member application fields and the six TNCSC plans
- **Plans now match tncsc.com/membership-registration** (CAD):
| Code | Plan | Price | Term | Notes |
|---|---|---|---|---|
| FAM | Annual/Family | $30 | 1 year | Covers member, spouse and kids at the same address |
| LONG | Long-Term Membership | $250 | 10 years | |
| LIFE | Life Term Membership | $500 | Lifetime | |
| SEN | Senior Annual Membership | $15 | 1 year | Age 65+, proof may be requested |
| SENLIFE | Senior Life Term | $250 | Lifetime | Age 60+, proof may be requested |
| STU | Student Annual Membership | $10 | 1 year | Full-time students, proof may be requested |
Every plan is subject to Board approval. The old "Individual" plan is archived, not deleted, so members already on it keep it.
- **Tier model** (`community_membership`): new fixed-term period (`term_years`), minimum age, "requires proof" flag, "includes family members" flag, and a signup description.
- **Member form, Membership tab**: first and last name (fills in the contact name), birth month and year with computed age, board approval state with Approve/Reject buttons, terms accepted, proof-of-eligibility upload, and an inline family members list. A "Pending Approval" filter was added to member search.
- **Eligibility section** (`tncsc_deployment`): the five Yes/No questions from the registration form (born in or origin of Tamil Nadu, PIO/OCI, speaks Tamil and lived in Tamil Nadu, spouse or parent Tamil and Indian, former citizenship of a neighbouring country). An unanswered question stays blank rather than counting as "No".
- Birth date, proof document and eligibility answers are visible to **Membership Managers only**.
- A plan's minimum age is enforced once a birth year is entered.
- `scripts/migrate_wp_members.py` maps WordPress levels to the new `LONG` and `SENLIFE` codes.
- Three older `community_membership` tests that already failed on a TNCSC install were fixed.
- Migration `tncsc_deployment/migrations/19.0.1.1.0/post-migrate.py` updates the plans on existing databases.
### `522e2cf`: broken and placeholder links across the website
| Where | Before | Now |
|---|---|---|
| Footer social icons (11 pages) | facebook.com, youtube.com, instagram.com homepages | TNCSC's own Facebook, YouTube and Instagram pages |
| "View Event" in page headers | Static product mock-up page | `/event` |
| Home "Book Now", Events "Register Event", picnic "Add To Cart" | Mock-up page or contact form | Real Summer Picnic registration (falls back to `/event`) |
| Home "All" / "Event" tabs | `#` | `/event` |
| Benefits "Become A Member" | `/contact` | `/membership/registration` |
| About "Learn More" | `/contact` | Same link, relabelled "Contact Us" |
| Member Login → `/my` | Error 500 for anonymous visitors | Redirects to login |
| Stock Odoo footer on built-in pages | Demo text, `info@yourcompany.example.com`, 555 phone, dead links | TNCSC links, company email, TNCSC social pages |
| Stock Odoo header on built-in pages | "Contact Us" to `/contactus`, fake phone number | "Contact Us" to `/contact`, company email |
Verified locally: every internal link on 16 pages resolves, and 34/34 tests pass for `community_membership`, `community_portal` and `tncsc_deployment`.
Migration `tncsc_deployment/migrations/19.0.1.2.0/pre-migrate.py` reloads the website pages on existing databases (see Gotchas).
### Other changes
- `.mcp.json` added to `.gitignore` (it holds live credentials).
- `docs/website-link-audit.md`: an earlier audit of the live site's links. It's untracked, so commit or discard it.
## Deploying to the server
Pulling and restarting is **not enough** when models or data change. Without the upgrade step, pages that read contacts fail with `column res_partner.first_name does not exist`. This happened once during this round. After every pull that touches a module:
```bash
git pull
docker compose exec odoo odoo -c /etc/odoo/odoo.conf -d metatrontncsc \
-u community_membership,community_portal,tncsc_deployment \
--stop-after-init --http-port=8099
docker compose restart odoo
```
- `--http-port=8099` stops the one-off upgrade from clashing with the running Odoo on 8069.
- Bump the module version in `__manifest__.py` whenever you add a migration script.
- A clean upgrade log shows `Running upgrade [...] post-migrate` / `pre-migrate` and `Modules loaded.` with no `ERROR`.
## Pending work
In priority order. **Blocked** means a decision is needed from TNCSC or the project lead first.
1. **Public membership signup page** (Blocked: payment timing)
- Build the application form on `/membership/registration` (or `/membership/join`), matching the live tncsc.com form: username, email, first and last name, password, phone, zip, city, country, month/year of birth, the five eligibility questions, avatar, terms, family members for Annual/Family, and proof upload for Senior and Student plans.
- **Username and email must be checked for duplicates**, as the user types and again on submit ("Username is taken").
- Coupon codes, and payment through the enabled providers (Interac is in `community_interac`).
- Each submission creates a member with approval state "Pending Approval".
- Then point the six "Sign Up" buttons on the Membership Registration page (still `/contact`) at the new form.
2. **Board approval workflow**: Approve/Reject only set the state today. Still needed: emails to the applicant on each decision, a full refund when rejected (the live site promises one), activation after approval and payment, and possibly a board-only group.
3. **Event registration end to end**: test ticket purchase and payment for the Summer Picnic (11–12 Oct 2026). The hero "Book Now" and the Events page card are tied to that one event (`tncsc_deployment.event_summer_picnic_2026`), so after 12 Oct they point at a finished event. Make them pick the next upcoming event, as the home event list already does. Also decide whether to delete the `/product/tncsc-summer-picnic-2026` mock-up page, which nothing links to now.
4. **Company website and base URL** (Blocked: domain decision): the company "Website" is `https://tncsc.com` and appears in emails, invoices and the portal. `web.base.url` is `http://`, so emailed links use http. Both are live-database settings. Set the base URL to `https://tncsc.odoo.thedomainnest.com`. Change Website only if tncsc.com won't point at this site at go-live.
5. **Contact form check**: the arithmetic question on `/contact` has an input with no name and no validation. Test delivery and spam handling. The stock `/contactus` page is still reachable by URL, but nothing links to it.
6. **WordPress import of sensitive fields** (Decide): the import deliberately skips date of birth and eligibility answers. Now that there are manager-only fields for them, decide with TNCSC whether to import them.
7. **Phase 9 leftovers** (from `HANDOFF.md`): banner images for every module, a `v1.0.0` tag and release report, and role guides (admin, treasurer, teacher, parent). Phase 9-B go-live: production `odoo.conf` (`list_db = False`, `proxy_mode`, workers), SSL, DNS cutover, firewall and backups. Go-live needs a person with server access; don't run it unattended.
8. **Housekeeping**
- Commit or discard `docs/website-link-audit.md`.
- Upgrade the local `communityos_dev` and `tncsc_migration_test` databases, which error because they predate the new fields.
- Fix `get_installed_modules` in the ODOO-MCP repo: it requests a `version` field that Odoo 19 removed.
## Decisions needed from TNCSC
1. **Payment timing**: do applicants pay at signup and get refunded if the board rejects them (what the live site says), or pay only after approval?
2. **Automatic rejection**: should any eligibility answer block an application outright (for example prior citizenship of a listed country), or does every application go to the board?
3. **Family coverage**: the site only says Annual/Family covers spouse and children. Do Long-Term and Life Term cover family too? (Currently only Annual/Family does.)
4. **Domain**: will tncsc.com point at this Odoo site at go-live? That decides the company Website field.
5. **Currency**: the plans page shows "$" without a currency, and checkout shows CAD. Confirm CAD.
## Gotchas learned this round
- **Website pages ignore upgrades.** `views/website_pages.xml` is `noupdate="1"` so website-editor changes survive upgrades. That also means template edits never reach an existing database, and flipping the `ir_model_data.noupdate` flag doesn't help (Odoo skips existing records in any `noupdate` file). To ship page changes, add a pre-migrate that reloads the file in `init` mode (copy `migrations/19.0.1.2.0/pre-migrate.py`) and bump the version. This overwrites editor edits to those pages.
- **Login-required routes crash.** On this Odoo build, `auth='user'` with `website=True` returns a 500 for anonymous visitors instead of redirecting. Use `auth='public'` and redirect to `/web/login?redirect=...` yourself, as the existing controllers do.
- **The server has editor copies of views.** It holds a website-specific copy of `website.footer_custom`, and a normal inherit of the generic view is hidden behind it. Override with a higher `priority` on `website.layout` (the TNCSC footer uses 90).
- **Keep client data out of product modules.** `scripts/check_brand_leak.py` runs in CI. Anything TNCSC-specific (eligibility questions, prices, names) goes in `tncsc_deployment`; `community_*` modules stay generic.
- **Test codes collide.** `tncsc_deployment` seeds tier codes FAM, LONG, LIFE, SEN, SENLIFE, STU and the `TNCSC-{year}-{seq}` member ID format. Tests in product modules must use their own codes and set the ID format explicitly.
- **Running Odoo in the dev container.** From Git Bash, prefix commands with `MSYS_NO_PATHCONV=1` or container paths get rewritten. For one-off runs add `--dev= --http-port=8099 --gevent-port=8098` so they don't fight the running server for ports. Example test run on a throwaway database:
```bash
MSYS_NO_PATHCONV=1 docker compose exec -T odoo odoo -c /etc/odoo/odoo.conf \
--dev= --http-port=8099 --gevent-port=8098 -d tncsc_test -i tncsc_deployment \
--test-enable --test-tags /community_membership,/community_portal,/tncsc_deployment \
--stop-after-init
docker compose exec -T db dropdb -U odoo --force tncsc_test
```
## Access and tooling
- **Odoo MCP**: `.mcp.json` in the repo root runs the odoo-mcp server (from the `ODOO-MCP` repo) against the live database. It holds the admin login, so it is gitignored and not in this file; ask the project lead for a copy. It has **write access to the live TNCSC database**. Consider `ODOO_READ_ONLY=true` unless you need writes. After adding it, restart Claude Code and approve `odoo-mcp` (or enable it in `/mcp`).
- **Local stack**: `cd deploy && docker compose up -d`, then open `http://localhost:10004/web?db=tncsc_site`. See `HANDOFF.md` for dev logins.
- **Security**: the admin password in `.mcp.json` is stored in plain text and appeared in an AI session transcript during this round. Rotate it, then update your local copy.