# Copyright 2015 Grupo ESOC IngenierĂ­a de Servicios, S.L.U. - Jairo Llopis # Copyright 2015 Antiun Ingenieria S.L. - Antonio Espinosa # Copyright 2017 Tecnativa - Pedro M. Baeza # Copyright 2018 EXA Auto Parts S.A.S Guillermo Montoya # Copyright 2018 EXA Auto Parts S.A.S Joan MarĂ­n # Copyright 2018 EXA Auto Parts S.A.S Juan Ocampo # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). from flectra import api, models class ResUsers(models.Model): _inherit = 'res.users' @api.onchange("firstname", "othernames", "lastname", "lastname2") def _compute_name(self): """Write the 'name' field according to splitted data.""" for partner in self: partner.name = partner.partner_id._get_computed_name( partner.firstname, partner.othernames, partner.lastname, partner.lastname2)