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.

24 lines
788 B

  1. # -*- coding: utf-8 -*-
  2. # © 2012-2016 Akretion (Alexis de Lattre <alexis.delattre@akretion.com>)
  3. # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
  4. from openerp import models, api
  5. class HrEmployee(models.Model):
  6. _name = 'hr.employee'
  7. _inherit = ['hr.employee', 'phone.common']
  8. _phone_fields = ['work_phone', 'mobile_phone']
  9. _phone_name_sequence = 30
  10. _country_field = 'country_id'
  11. _partner_field = None
  12. @api.model
  13. def create(self, vals):
  14. vals_reformated = self._reformat_phonenumbers_create(vals)
  15. return super(HrEmployee, self).create(vals_reformated)
  16. @api.multi
  17. def write(self, vals):
  18. vals_reformated = self._reformat_phonenumbers_write(vals)
  19. return super(HrEmployee, self).write(vals_reformated)