You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

14 lines
426 B

  1. # -*- coding: utf-8 -*-
  2. from openerp import models, fields, api
  3. from openerp.addons.beesdoo_base.tools import concat_names
  4. class Partner(models.Model):
  5. _inherit = 'res.partner'
  6. first_name = fields.Char('First Name')
  7. last_name = fields.Char('Last Name', required=True)
  8. @api.onchange('first_name', 'last_name')
  9. def _on_change_name(self):
  10. self.name = concat_names(self.first_name, self.last_name)