Set default values for One2many field
问题 I have a class student_student which have a one2many field result_ids defined like the following: result_ids = fields.One2many("schoolresults.detail", "student_id", "School Results", default="_get_subjects") and def _get_subjects(self): cr = self.pool.cursor() self.env return self.pool.get('schoolresults.subject').search(cr, self.env.uid, []) in the other side I have a class schoolresults_subject : class schoolresults_subject(models.Model): _name = "schoolresults.subject" _description =