title: how to update One2many list with value [ODOO 12]
body: <p>I added a method that does a research of the teacher in the lessons then he added in the yard (the course several lesson, each lesson a single teacher) 
  my problem is when I click on the button it does not the table update, he has added another line below each click </p>
  
  <p>it's my code</p>
  
  <pre><code>    teacher_ids = fields.One2many('school.teacher', 'course_id', string='Teacher')
  
      def get_teachers (self):
          lesson = self.env['school.lesson'].search([])
  
          teacher_list = []  
          for rec in lesson:
              if rec.course_id.id == self.id:
                  print(rec.teacher_id.name)
  
                  teacher_list.append([0,0,{
                                      'teacher_name':  rec.teacher_id.id,  
                                      'lesson_id': rec.id,
                                  }])
          print('teacher_list',teacher_list)
          self.write({'teacher_ids' : teacher_list})
          return 
  </code></pre>
  
  <p>I found that</p>
  
  <pre><code>(6, 0, [IDs])          replace the list of linked IDs (like using (5) then (4,ID) for each ID in the list of IDs)
  </code></pre>
  
  <p>but I do not know how used in my method</p>