title: Can't override write method on Odoo 14
body: <p>I tried to override the write function but with no result, here is my code:</p>
  <pre><code>@api.model
  def write(self,vals):
      rec=super(MajRhemployee,self).write(vals) 
      for record in rec:
          date_act= datetime.date.today()
          if  record.date_recrutement:
              bdate = fields.Datetime.to_datetime(record.date_recrutement).date()
              total_age= str(int((date_act - bdate).days/30))
              age=total_age
              
              if int(age)&lt;4 :
                      a=self.env[&quot;majrh.cadre&quot;].search([(&quot;id&quot;,&quot;=&quot;,(record.fonction.cadre_id2.id)+1)])
                      self.env['hru.fonction'].search([&quot;id&quot;,&quot;=&quot;,record.fonction.id]).write({
                                                                      &quot;nom&quot;:record.nom,
                                                                      &quot;prenom&quot;:record.prenom,
                                                                      &quot;fonction_id&quot;:record.fonction.id,
                                                                      &quot;corps_id_src&quot;:record.fonction.corps_id2,
                                                                      &quot;cadre_id_src&quot;:record.fonction.cadre_id2,
                                                                      &quot;grade_id_src&quot;:record.fonction.grade_id2,
                                                                      &quot;categorie_id_src&quot;:record.fonction.categorie_id,
                                                                      &quot;echelle_id_src&quot;:record.fonction.echelle_id,
                                                                      &quot;echelon_id_src&quot;:record.fonction.echelon_id,
                                                                      &quot;indice_src&quot;:record.fonction.indice,
                                                                      &quot;cadre_id_des&quot;:a.code
                                                                    })
                                           
      return record
  </code></pre>