feat(plating-team): Owner-only Team kanban + Designated Official fields

Phase F of permissions overhaul.

Adds res.users.x_fc_plating_role Selection field (8 options matching
the role hierarchy). Compute reads highest plating group from
groups_id (precedence: owner > QM > manager > sales_manager >
shop_manager > sales_rep > technician). Inverse uses sudo().write()
to clear all plating-role groups (additive-by-default m2m (3, id))
then adds the chosen one, and posts a Markup-wrapped chatter audit
naming the actor.

New Owner-only menu: Plating > Configuration > Team. Standard
res.users kanban grouped by x_fc_plating_role with records_draggable
for drag-and-drop role changes. Domain hides shared/portal users
and archived users.

res.company gains two Designated Official fields:
- x_fc_cgp_designated_official_id (CGP DO per Defence Production Act §22)
- x_fc_nadcap_authority_user_id (Nadcap signer)

Both tracking=True for audit. View-level domain restricts picker to
Owner or Quality Manager users via [(ref('...'), ref('...'))] xmlid
domains. New 'Plating Designated Officials' page on res.company form,
Owner-only visibility.

Tests in test_team_page.py cover compute/inverse/chatter/menu.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
gsinghpal
2026-05-24 02:03:44 -04:00
parent 830b29ce49
commit 89a937fb32
8 changed files with 336 additions and 1 deletions

View File

@@ -185,3 +185,28 @@ class ResCompany(models.Model):
'When BOTH are blank the report falls back to a hardcoded '
'AS9100/ISO 9001 statement.',
)
# =====================================================================
# Phase F — Plating Designated Officials
# =====================================================================
# These are SPECIFIC NAMED PEOPLE registered with regulatory bodies.
# Stored as Many2one to res.users so the link survives renames.
# View-level domain restricts the picker to Owner or Quality Manager
# group members (a Python-side domain would resolve groups by id at
# recordset load and is fragile across DB migrations).
x_fc_cgp_designated_official_id = fields.Many2one(
'res.users',
string='CGP Designated Official',
tracking=True,
help='Specific person registered with PSPC as Designated Official '
'under Defence Production Act §22. Must be Owner or Quality '
'Manager.',
)
x_fc_nadcap_authority_user_id = fields.Many2one(
'res.users',
string='Nadcap Authority',
tracking=True,
help='Specific person who signs Nadcap-specific certificates and '
'audits. Must be Owner or Quality Manager.',
)