diff --git a/hr_phone/__init__.py b/hr_phone/__init__.py index df6eeaa..e220360 100644 --- a/hr_phone/__init__.py +++ b/hr_phone/__init__.py @@ -1,22 +1,3 @@ # -*- coding: utf-8 -*- -############################################################################## -# -# HR Phone module for Odoo/OpenERP -# Copyright (C) 2014 Alexis de Lattre -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as -# published by the Free Software Foundation, either version 3 of the -# License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see . -# -############################################################################## from . import hr_phone diff --git a/hr_phone/__openerp__.py b/hr_phone/__openerp__.py index 90bd7da..6612ef7 100644 --- a/hr_phone/__openerp__.py +++ b/hr_phone/__openerp__.py @@ -1,28 +1,10 @@ -# -*- encoding: utf-8 -*- -############################################################################## -# -# HR Phone module for OpenERP -# Copyright (C) 2014 Alexis de Lattre -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as -# published by the Free Software Foundation, either version 3 of the -# License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see . -# -############################################################################## - +# -*- coding: utf-8 -*- +# © 2014-2016 Akretion (Alexis de Lattre ) +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). { 'name': 'HR Phone', - 'version': '8.0.0.1.0', + 'version': '9.0.1.0.0', 'category': 'Phone', 'license': 'AGPL-3', 'summary': 'Validate phone numbers in HR', @@ -46,8 +28,6 @@ for any help or question about this module. 'security/ir.model.access.csv', 'hr_view.xml', ], - 'images': [], - 'installable': False, + 'installable': True, 'auto_install': True, - 'active': False, } diff --git a/hr_phone/hr_phone.py b/hr_phone/hr_phone.py index 3844a85..7ba0a83 100644 --- a/hr_phone/hr_phone.py +++ b/hr_phone/hr_phone.py @@ -1,29 +1,11 @@ -# -*- encoding: utf-8 -*- -############################################################################## -# -# HR phone module for Odoo/OpenERP -# Copyright (c) 2012-2014 Akretion (http://www.akretion.com) -# @author: Alexis de Lattre -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as published -# by the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see . -# -############################################################################## +# -*- coding: utf-8 -*- +# © 2012-2016 Akretion (Alexis de Lattre ) +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -from openerp.osv import orm +from openerp import models, api -class hr_employee(orm.Model): +class HrEmployee(models.Model): _name = 'hr.employee' _inherit = ['hr.employee', 'phone.common'] _phone_fields = ['work_phone', 'mobile_phone'] @@ -31,14 +13,12 @@ class hr_employee(orm.Model): _country_field = 'country_id' _partner_field = None - def create(self, cr, uid, vals, context=None): - vals_reformated = self._generic_reformat_phonenumbers( - cr, uid, None, vals, context=context) - return super(hr_employee, self).create( - cr, uid, vals_reformated, context=context) + @api.model + def create(self, vals): + vals_reformated = self._reformat_phonenumbers_create(vals) + return super(HrEmployee, self).create(vals_reformated) - def write(self, cr, uid, ids, vals, context=None): - vals_reformated = self._generic_reformat_phonenumbers( - cr, uid, ids, vals, context=context) - return super(hr_employee, self).write( - cr, uid, ids, vals_reformated, context=context) + @api.multi + def write(self, vals): + vals_reformated = self._reformat_phonenumbers_write(vals) + return super(HrEmployee, self).write(vals_reformated) diff --git a/hr_phone/hr_view.xml b/hr_phone/hr_view.xml index b1bed5a..cfbf45d 100644 --- a/hr_phone/hr_view.xml +++ b/hr_phone/hr_view.xml @@ -1,12 +1,13 @@ + hr_phone.hr_employee.form hr.employee @@ -43,5 +44,6 @@ +