metatroncubeswdev 657792b268
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
Add member application fields and the six real TNCSC membership plans
community_membership:
- Tiers get a fixed-term period (term_years), minimum age, a
  proof-document flag, a family-member flag and a signup description.
- Members get first/last name (composing the contact name), month and
  year of birth with computed age, board approval state with
  approve/reject buttons, terms acceptance, a proof-of-eligibility upload
  and an inline family members list. Birth date and proof document are
  restricted to Membership Managers.
- Constraints: plausible birth year; a tier's minimum age is enforced
  when the birth year is known.
- Fix pre-existing tests that collided with deployment-seeded tier codes
  and member ID format.

tncsc_deployment:
- Five Yes/No eligibility questions from the tncsc.com registration form
  (manager-only), shown in an Eligibility section of the member form.
- Tiers now match tncsc.com/membership-registration: Annual/Family $30,
  Long-Term (10 yr) $250, Life $500, Senior Annual (65+) $15, Senior Life
  (60+) $250, Student Annual $10 (CAD).
- 19.0.1.1.0 post-migrate rewrites existing tiers (noupdate data) and
  archives the unused Individual tier.

scripts/migrate_wp_members.py maps WordPress levels to the new LONG and
SENLIFE tiers. .mcp.json (holds credentials) is now gitignored.

Verified on the local Docker stack: -u on tncsc_site ran the migration
cleanly, and a fresh install with --test-enable passed 32/32 tests for
community_membership and tncsc_deployment.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-27 10:46:31 -04:00

37 lines
1.6 KiB
Python

from odoo import fields, models
MANAGER_GROUP = 'community_membership.group_membership_manager'
YES_NO = [('yes', 'Yes'), ('no', 'No')]
class ResPartner(models.Model):
"""TNCSC membership eligibility answers, asked on the registration form.
Stored as Yes/No selections rather than booleans so an unanswered
question stays distinguishable from a "No".
"""
_inherit = 'res.partner'
tncsc_born_tamil_nadu = fields.Selection(
YES_NO, string='Born in / Origin of Tamil Nadu', groups=MANAGER_GROUP,
help='Are you "born in Tamil Nadu, India" or born in any part of India but origin of Tamil Nadu?',
)
tncsc_pio_oci = fields.Selection(
YES_NO, string='Holds / Qualifies for PIO or OCI', groups=MANAGER_GROUP,
help='Are you the holder of Indian PIO/OCI or qualified to obtain one?',
)
tncsc_tamil_speaker_resident = fields.Selection(
YES_NO, string='Speaks Tamil, Lived in Tamil Nadu', groups=MANAGER_GROUP,
help='Do you speak Tamil and ever lived in Tamil Nadu, India with Indian citizenship?',
)
tncsc_family_tamil_indian = fields.Selection(
YES_NO, string='Spouse / Parent Tamil & Indian', groups=MANAGER_GROUP,
help='Does your spouse or either of your parents speak Tamil and have Indian citizenship, '
'or ever had Indian citizenship before migrating to Canada?',
)
tncsc_other_citizenship = fields.Selection(
YES_NO, string='Former Citizenship (Neighbouring Country)', groups=MANAGER_GROUP,
help='Had you ever been a citizen of Afghanistan, Bangladesh, Bhutan, China, Nepal, '
'Pakistan or Sri Lanka?',
)