feat(sub12a): add fp.step.template.transition.input

Transition-time prompts (fired when leaving a step). Authored now,
runtime-consumed in Sub 12b's Move Parts dialog. Carries a
compliance_tag selection (none/as9100/nadcap/cgp/nuclear) so audit
reports can filter by regulation regime.

input_type covers Steelhead's transition prompts: text, number,
boolean, selection, date, signature, photo, location_picker,
customer_wo.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
gsinghpal
2026-04-27 20:31:45 -04:00
parent 8bcd537737
commit 7a0e74c456

View File

@@ -0,0 +1,50 @@
# -*- coding: utf-8 -*-
# Copyright 2026 Nexa Systems Inc.
# License OPL-1 (Odoo Proprietary License v1.0)
# Part of the Fusion Plating product family.
from odoo import fields, models
class FpStepTemplateTransitionInput(models.Model):
"""Transition-time compliance field definition.
Fires when leaving a step (e.g. "Customer WO #", "Photo Evidence",
"Scrap Reason"). Authored on `fp.step.template`, snapshot-copied
onto `fusion.plating.process.node` when the library step is dragged
into a recipe. Sub 12b uses these to render the Move Parts dialog.
"""
_name = 'fp.step.template.transition.input'
_description = 'Fusion Plating — Step Template Transition Input'
_order = 'sequence, name'
name = fields.Char(string='Name', required=True, translate=True)
template_id = fields.Many2one(
'fp.step.template', string='Template',
required=True, ondelete='cascade', index=True,
)
input_type = fields.Selection([
('text', 'Text'),
('number', 'Number'),
('boolean', 'Yes/No'),
('selection', 'Selection'),
('date', 'Date / Time'),
('signature', 'Signature'),
('photo', 'Photo'),
('location_picker', 'Location Picker'),
('customer_wo', 'Customer WO #'),
], string='Input Type', required=True, default='text')
required = fields.Boolean(string='Required', default=False,
help='If True, the move is hard-blocked while this input is blank.')
hint = fields.Char(string='Hint')
selection_options = fields.Text(string='Selection Options',
help='Comma-separated when input_type is "selection".')
sequence = fields.Integer(string='Sequence', default=10)
compliance_tag = fields.Selection([
('none', 'None'),
('as9100', 'AS9100'),
('nadcap', 'Nadcap'),
('cgp', 'Controlled Goods'),
('nuclear', 'Nuclear'),
], string='Compliance Tag', default='none',
help='Drives audit-report inclusion / filtering.')