I have a many2many field employee_idv01
, How Can I create records for planning model
with each employee.
for example if record.employee_idv01
=== hr.employee(6,3) I need to create a record for hr.employee(6) and another for hr.employee(3)
@api.model
def create(self, vals):
record = super(affectation3, self).create(vals)
if record.employee_idv01:
for i in self.employee_idv01??:
(how can I create records for planning with each employee???)
self.env['planning'].create({
'employee_id': record.????,
'date_r01': record.date_r1,
'date_r02': record.date_r2,
})