Pass values to the list view by the wizard !? (Odoo 13)



I have 3 models: :

time_b = fields.Datetime("Your time",

#get value from module planning

role_b = fields.Many2one("planning.role", "Your role")

o_2_m = fields.One2many('model.a', 'keya')

state = fields.Selection([

            ('draf', 'DRAF'),

            ('confirm', 'CONFIRMED'),

            (cancel', 'CANCEL'),

            ],default='draf') :

employee_id = fields.Many2one('hr.employee', 'Employee')

keya = fields.Many2one('model.b')

name = fields.Many2one('hr.employee', 'Employee')

time_c = fields.Datetime('Your time')

role_c = fields.Many2one('planning.role', 'Your role)

XML of :

<record id="model_c_tree_view" model="ir.ui.view">

            <field name="name">model.c.tree.view</field>

            <field name="model">model.c</field>

            <field name="arch" type="xml">


                    <field name="name"/>

                    <field name="role_c"/>

                    <field name="time_c"/>




I want to pass all values selected of the field: 'employee_id' of in the o_2_m field, and field 'role_b' and 'time_b' of to the list view of via the wizard button.

I created the method of like this:

def confirm(self):

        for rec in self:

            if rec.o_2_m:

                for line in rec.o_2_m:

                    bc = self.env["model.c"].search([])

                    if bc:

                        bc['name'] =

                        bc['role_c'] = self.role_b

                        bc['time_c'] = self.time_b                    

            rec.state = "confirmed"                      

        return True 

After click on the "Add a line" link in the o_2_m tree view, and selected records of and selected value for two fields of in the form view of, and click the 'confirm' button...  It still not work! 

Please help!

Thank you!