title: how to pass list records to many2many field?
body: <p>i need to get the range between 2 years on a many2many field each year must be a record on the model </p>
  
  <p>i added 2 fields to get the 2 years and and method to get the range between them </p>
  
  <pre><code>class yearrange(models.Model):
  _name = 'yearrange'
  _rec_name = 'name'
  
  name = fields.Char()
  
   class autopart(models.Model):
  _inherit = 'product.template'
  
  @api.multi
  @api.depends('start', 'end')
  def years(self):
      record = [int(x) for x in range(int(self.start), int(self.end))]
      for rec in self:
          rec.rang=record
  
  start = fields.Char(string="", required=False, )
  end = fields.Char(string="", required=False, )
  rang = fields.Many2many(comodel_name="yearrange", string="",compute=years )
  </code></pre>
  
  <p>if i add any data to the field of years i get this error 
  Missing record
  Record does not exist or has been deleted.</p>
  
  <p>(Records: [2010, 2016, 2017, 2018, 2019, 2020], User: 2)</p>