1
我有一個many2many字段employee_idv01
,如何爲每個員工創建planning model
的記錄。用many2many字段填寫many2one
例如如果record.employee_idv01
=== hr.employee(6,3)我需要創建hr.employee(6)的記錄,而另一個用於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,
})