feat(sub12a): add fp.step.template.input
Operation-measurement definitions for library step templates. The input_type selection covers Steelhead's input shapes (text, number, boolean, selection, date, signature, time_hms, time_seconds, temperature, thickness, pass_fail). target_min/max + target_unit are structured (not embedded in the name string the way Steelhead does it) so the traveller report can render target vs actual side-by-side and colour-code out-of-range values. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,47 @@
|
||||
# -*- 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 FpStepTemplateInput(models.Model):
|
||||
"""Operation measurement definition on a step library template.
|
||||
|
||||
Recorded *during* a step (e.g. "Actual Time", "Plating Thickness").
|
||||
Distinct from transition_input_ids which fire when leaving the
|
||||
step.
|
||||
"""
|
||||
_name = 'fp.step.template.input'
|
||||
_description = 'Fusion Plating — Step Template 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'),
|
||||
('time_hms', 'Time (HH:MM:SS)'),
|
||||
('time_seconds', 'Time (seconds)'),
|
||||
('temperature', 'Temperature'),
|
||||
('thickness', 'Thickness'),
|
||||
('pass_fail', 'Pass / Fail'),
|
||||
], string='Input Type', required=True, default='text')
|
||||
target_min = fields.Float(string='Target Min')
|
||||
target_max = fields.Float(string='Target Max')
|
||||
target_unit = fields.Char(string='Target Unit',
|
||||
help='Display unit, e.g. "min", "°F", "A", "FT2", "in".')
|
||||
required = fields.Boolean(string='Required', default=False,
|
||||
help='If True, sign-off 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)
|
||||
Reference in New Issue
Block a user