Set default values for One2many field
<p>I have a class <code>student_student</code> which have a one2many field<code>result_ids</code> defined like the following:</p>

<pre><code>    result_ids = fields.One2many("schoolresults.detail", "student_id", "School Results", default="_get_subjects")
</code></pre>

<p>and </p>

<pre><code>def _get_subjects(self):
     cr = self.pool.cursor()
     self.env
     return self.pool.get('schoolresults.subject').search(cr, self.env.uid, [])
</code></pre>

<p>in the other side I have a class <code>schoolresults_subject</code>:</p>

<pre><code>class schoolresults_subject(models.Model):
    _name = "schoolresults.subject"
    _description = "Student's subjects."
    name = fields.Char("Subject")

class schoolresults_detail(models.Model):
    _name = "schoolresults.detail"
    _description = "Student's results."
    student_id = fields.Many2one("student.student", "Student", ondelete="cascade")
    subject_id = fields.Many2one("schoolresults.subject", "Subject")
    result = fields.Float("Result", compute='_compute_value', store=True)
</code></pre>

<p>What I'm trying to do is to fill the result_ids with a subjects list from the last class, whenever the user trying to create a new student profile, using the the <code>default</code> parameter in the one2many field.
But whenever I try to create a student profile I get this error <code>Wrong values for student.student.result_ids</code>.
Please is there anyway to achieve that?
<a href="https://i.stack.imgur.com/j2m2N.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/j2m2N.png" alt="enter image description here"></a></p>

<p><strong>PS. I'm using Odoo 9</strong></p>