from odoo import models, fields

class Sos_FIR_TestingParameters(models.Model):
    _name = 'sos_fir_testing_parameters'
    _description = 'SOS FIR Testing Parameters'
    _rec_name='product_type'

    product_type = fields.Selection(
            [
                ('BHMS 1.2V', 'BHMS 1.2V'), 
                ('BHMS 2V', 'BHMS 2V'), 
                ('BHMS 12V', 'BHMS 12V'),  
                ('BHMS 48V', 'BHMS 48V'),
                ('BMS-HV', 'BMS-HV'),
                ('BMS-LV 100A', 'BMS-LV 100A'), 
                ('BMS-LV 40A', 'BMS-LV 40A'), 
                ('SBMS 55A', 'SBMS 55A'),              
                ('MC 250W', 'MC 250W'),                                
                ('HeartTarang', 'HeartTarang')                  
            ],
            string="Product Name")
    fir_parameter_ids = fields.One2many('sos_fir_testing_parameters_lines', 'testing_id', string= 'FIR Testing Parameters',copy=True)

class SosFIR_Parameter(models.Model):
    _name = 'sos_fir_testing_parameters_lines'
    _description = 'SOS FIR Testing Parameter'
    sequence = fields.Integer(string="sequence")
    name = fields.Char(string='Parameter Name', required=True)
    inspection_decision = fields.Selection([('PASS','PASS'),('FAIL','FAIL')],string="Inspection Decision",default="PASS")
    specification = fields.Char(string="Specification")
    results = fields.Text(string="Results")
    testing_id = fields.Many2one('sos_fir_testing_parameters', string='Testing Parameters')
