From ccdbbd9952bc34eac1d3284787b768f85bbe9706 Mon Sep 17 00:00:00 2001 From: Antonio Esposito Date: Tue, 24 Jan 2017 14:27:03 +0100 Subject: [PATCH] [MIG] hr_employee_firstname: Migrated to 10.0 (#276) --- hr_employee_firstname/README.rst | 12 ++--- hr_employee_firstname/__init__.py | 23 ++-------- hr_employee_firstname/__manifest__.py | 27 ++++++++++++ hr_employee_firstname/__openerp__.py | 44 ------------------- hr_employee_firstname/i18n/ar.po | 20 +++++---- hr_employee_firstname/i18n/de.po | 24 +++++----- hr_employee_firstname/i18n/es.po | 16 +++---- hr_employee_firstname/i18n/fi.po | 2 +- hr_employee_firstname/i18n/fr.po | 24 +++++----- hr_employee_firstname/i18n/hr.po | 34 ++++++++++++++ hr_employee_firstname/i18n/hr_HR.po | 34 ++++++++++++++ .../i18n/hr_employee_firstname.pot | 32 -------------- hr_employee_firstname/i18n/it.po | 16 +++---- hr_employee_firstname/i18n/nl_NL.po | 16 +++---- hr_employee_firstname/i18n/pt_BR.po | 16 +++---- hr_employee_firstname/i18n/ro.po | 24 +++++----- hr_employee_firstname/i18n/sl.po | 16 +++---- hr_employee_firstname/init_hook.py | 11 +++++ hr_employee_firstname/models/__init__.py | 22 +--------- hr_employee_firstname/models/hr_employee.py | 40 ++++------------- hr_employee_firstname/tests/__init__.py | 3 ++ .../tests/test_hr_employee_firstname.py | 44 ++++++++----------- hr_employee_firstname/views/hr_view.xml | 35 ++++++++------- 23 files changed, 258 insertions(+), 277 deletions(-) create mode 100644 hr_employee_firstname/__manifest__.py delete mode 100644 hr_employee_firstname/__openerp__.py create mode 100644 hr_employee_firstname/i18n/hr.po create mode 100644 hr_employee_firstname/i18n/hr_HR.po delete mode 100644 hr_employee_firstname/i18n/hr_employee_firstname.pot create mode 100644 hr_employee_firstname/init_hook.py diff --git a/hr_employee_firstname/README.rst b/hr_employee_firstname/README.rst index c0ff8a600cdf..d5631065f612 100644 --- a/hr_employee_firstname/README.rst +++ b/hr_employee_firstname/README.rst @@ -1,5 +1,6 @@ .. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg - :alt: License: AGPL-3 + :target: https://www.gnu.org/licenses/agpl-3.0-standalone.html + :alt: License: AGPL-3 HR Employee First Name, Last Name ================================= @@ -12,7 +13,7 @@ Installation To install this module, you need to: -* clone the branch 8.0 of the repository https://github.com/OCA/hr +* clone the branch 10.0 of the repository https://github.com/OCA/hr * add the path to this repository in your configuration (addons-path) * update the module list * search for "HR Employee First Name, Last Name" in your addons @@ -43,13 +44,14 @@ Contributors * Fekete Mihai * David Dufresne * Adrien Peiffer (ACSONE) +* Antonio Esposito (ONESTEIN BV) Maintainer ---------- -.. image:: http://odoo-community.org/logo.png +.. image:: https://odoo-community.org/logo.png :alt: Odoo Community Association - :target: http://odoo-community.org + :target: https://odoo-community.org This module is maintained by the OCA. @@ -57,4 +59,4 @@ OCA, or the Odoo Community Association, is a nonprofit organization whose mission is to support the collaborative development of Odoo features and promote its widespread use. -To contribute to this module, please visit http://odoo-community.org. +To contribute to this module, please visit https://odoo-community.org. diff --git a/hr_employee_firstname/__init__.py b/hr_employee_firstname/__init__.py index ba5b716b3e7b..98c5a36df58f 100644 --- a/hr_employee_firstname/__init__.py +++ b/hr_employee_firstname/__init__.py @@ -1,23 +1,6 @@ # -*- coding: utf-8 -*- -############################################################################## -# -# OpenERP, Open Source Management Solution -# This module copyright (C) 2010 - 2014 Savoir-faire Linux -# (). -# -# 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 . -# -############################################################################## +# Copyright (C) 2010 - 2014 Savoir-faire Linux () +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). from . import models +from .init_hook import post_init_hook diff --git a/hr_employee_firstname/__manifest__.py b/hr_employee_firstname/__manifest__.py new file mode 100644 index 000000000000..8b38269757cd --- /dev/null +++ b/hr_employee_firstname/__manifest__.py @@ -0,0 +1,27 @@ +# -*- coding: utf-8 -*- +# © 2010 - 2014 Savoir-faire Linux () +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +{ + 'name': 'HR Employee First Name, Last Name', + 'version': '10.0.1.0.0', + 'author': "Savoir-faire Linux, " + "Fekete Mihai (Forest and Biomass Services Romania), " + "Odoo Community Association (OCA)", + 'maintainer': 'Savoir-faire Linux', + 'website': 'http://www.savoirfairelinux.com', + 'license': 'AGPL-3', + 'category': 'Human Resources', + 'summary': 'Adds First Name to Employee', + 'depends': [ + 'hr', + 'partner_firstname', + ], + 'data': [ + 'views/hr_view.xml', + ], + "post_init_hook": "post_init_hook", + 'demo': [], + 'test': [], + 'installable': True, +} diff --git a/hr_employee_firstname/__openerp__.py b/hr_employee_firstname/__openerp__.py deleted file mode 100644 index 1718b30e5f31..000000000000 --- a/hr_employee_firstname/__openerp__.py +++ /dev/null @@ -1,44 +0,0 @@ -# -*- coding: utf-8 -*- -############################################################################## -# -# OpenERP, Open Source Management Solution -# This module copyright (C) 2010 - 2014 Savoir-faire Linux -# (). -# -# 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 . -# -############################################################################## - -{ - 'name': 'HR Employee First Name, Last Name', - 'version': '8.0.0.0.2', - 'author': "Savoir-faire Linux, " - "Fekete Mihai (Forest and Biomass Services Romania), " - "Odoo Community Association (OCA)", - 'maintainer': 'Savoir-faire Linux', - 'website': 'http://www.savoirfairelinux.com', - 'license': 'AGPL-3', - 'category': 'Human Resources', - 'summary': 'Adds First Name to Employee', - 'depends': [ - 'hr', - 'partner_firstname', - ], - 'data': [ - 'views/hr_view.xml', - ], - 'demo': [], - 'test': [], - 'installable': True, -} diff --git a/hr_employee_firstname/i18n/ar.po b/hr_employee_firstname/i18n/ar.po index efcd94b3a3b1..259742eeefe5 100644 --- a/hr_employee_firstname/i18n/ar.po +++ b/hr_employee_firstname/i18n/ar.po @@ -3,14 +3,16 @@ # * hr_employee_firstname # # Translators: +# OCA Transbot , 2017 +# abdullah alsabi , 2017 msgid "" msgstr "" -"Project-Id-Version: hr (8.0)\n" +"Project-Id-Version: Odoo Server 10.0\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2015-11-30 05:19+0000\n" -"PO-Revision-Date: 2015-08-13 14:31+0000\n" -"Last-Translator: <>\n" -"Language-Team: Arabic (http://www.transifex.com/oca/OCA-hr-8-0/language/ar/)\n" +"POT-Creation-Date: 2017-06-10 04:30+0000\n" +"PO-Revision-Date: 2017-06-10 04:30+0000\n" +"Last-Translator: abdullah alsabi , 2017\n" +"Language-Team: Arabic (https://www.transifex.com/oca/teams/23907/ar/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: \n" @@ -23,11 +25,11 @@ msgid "Employee" msgstr "الموظف" #. module: hr_employee_firstname -#: field:hr.employee,firstname:0 +#: model:ir.model.fields,field_description:hr_employee_firstname.field_hr_employee_firstname msgid "Firstname" -msgstr "" +msgstr "الإسم الأول" #. module: hr_employee_firstname -#: field:hr.employee,lastname:0 +#: model:ir.model.fields,field_description:hr_employee_firstname.field_hr_employee_lastname msgid "Lastname" -msgstr "" +msgstr "إسم العائلة" diff --git a/hr_employee_firstname/i18n/de.po b/hr_employee_firstname/i18n/de.po index 1f03c294dee8..2ab540f3a865 100644 --- a/hr_employee_firstname/i18n/de.po +++ b/hr_employee_firstname/i18n/de.po @@ -1,19 +1,22 @@ # Translation of Odoo Server. # This file contains the translation of the following modules: -# * hr_employee_firstname -# +# * hr_employee_firstname +# +# Translators: +# OCA Transbot , 2017 msgid "" msgstr "" -"Project-Id-Version: Odoo Server 8.0\n" +"Project-Id-Version: Odoo Server 10.0\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2015-04-24 10:20+0000\n" -"PO-Revision-Date: 2015-04-24 10:20+0000\n" -"Last-Translator: <>\n" -"Language-Team: \n" +"POT-Creation-Date: 2017-01-28 02:12+0000\n" +"PO-Revision-Date: 2017-01-28 02:12+0000\n" +"Last-Translator: OCA Transbot , 2017\n" +"Language-Team: German (https://www.transifex.com/oca/teams/23907/de/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: \n" -"Plural-Forms: \n" +"Language: de\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" #. module: hr_employee_firstname #: model:ir.model,name:hr_employee_firstname.model_hr_employee @@ -21,12 +24,11 @@ msgid "Employee" msgstr "Angestellter" #. module: hr_employee_firstname -#: field:hr.employee,firstname:0 +#: model:ir.model.fields,field_description:hr_employee_firstname.field_hr_employee_firstname msgid "Firstname" msgstr "Vorname" #. module: hr_employee_firstname -#: field:hr.employee,lastname:0 +#: model:ir.model.fields,field_description:hr_employee_firstname.field_hr_employee_lastname msgid "Lastname" msgstr "Nachname" - diff --git a/hr_employee_firstname/i18n/es.po b/hr_employee_firstname/i18n/es.po index 01f88593516e..a20884c0e400 100644 --- a/hr_employee_firstname/i18n/es.po +++ b/hr_employee_firstname/i18n/es.po @@ -3,15 +3,15 @@ # * hr_employee_firstname # # Translators: -# Antonio Trueba, 2016 +# OCA Transbot , 2017 msgid "" msgstr "" -"Project-Id-Version: hr (8.0)\n" +"Project-Id-Version: Odoo Server 10.0\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2015-11-30 05:19+0000\n" -"PO-Revision-Date: 2016-02-05 12:48+0000\n" -"Last-Translator: Antonio Trueba\n" -"Language-Team: Spanish (http://www.transifex.com/oca/OCA-hr-8-0/language/es/)\n" +"POT-Creation-Date: 2017-01-28 02:12+0000\n" +"PO-Revision-Date: 2017-01-28 02:12+0000\n" +"Last-Translator: OCA Transbot , 2017\n" +"Language-Team: Spanish (https://www.transifex.com/oca/teams/23907/es/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: \n" @@ -24,11 +24,11 @@ msgid "Employee" msgstr "Empleado" #. module: hr_employee_firstname -#: field:hr.employee,firstname:0 +#: model:ir.model.fields,field_description:hr_employee_firstname.field_hr_employee_firstname msgid "Firstname" msgstr "Nombre propio" #. module: hr_employee_firstname -#: field:hr.employee,lastname:0 +#: model:ir.model.fields,field_description:hr_employee_firstname.field_hr_employee_lastname msgid "Lastname" msgstr "Apellidos" diff --git a/hr_employee_firstname/i18n/fi.po b/hr_employee_firstname/i18n/fi.po index 770ccba57b3d..3e6a6e6bcd65 100644 --- a/hr_employee_firstname/i18n/fi.po +++ b/hr_employee_firstname/i18n/fi.po @@ -5,7 +5,7 @@ # Translators: msgid "" msgstr "" -"Project-Id-Version: hr (8.0)\n" +"Project-Id-Version: hr (10.0)\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2016-04-14 04:15+0000\n" "PO-Revision-Date: 2016-04-04 11:07+0000\n" diff --git a/hr_employee_firstname/i18n/fr.po b/hr_employee_firstname/i18n/fr.po index 36d16120c3df..d6c0216d8d4a 100644 --- a/hr_employee_firstname/i18n/fr.po +++ b/hr_employee_firstname/i18n/fr.po @@ -1,19 +1,22 @@ # Translation of Odoo Server. # This file contains the translation of the following modules: -# * hr_employee_firstname -# +# * hr_employee_firstname +# +# Translators: +# OCA Transbot , 2017 msgid "" msgstr "" -"Project-Id-Version: Odoo Server 8.0\n" +"Project-Id-Version: Odoo Server 10.0\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2015-04-24 10:20+0000\n" -"PO-Revision-Date: 2015-04-24 10:20+0000\n" -"Last-Translator: <>\n" -"Language-Team: \n" +"POT-Creation-Date: 2017-01-28 02:12+0000\n" +"PO-Revision-Date: 2017-01-28 02:12+0000\n" +"Last-Translator: OCA Transbot , 2017\n" +"Language-Team: French (https://www.transifex.com/oca/teams/23907/fr/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: \n" -"Plural-Forms: \n" +"Language: fr\n" +"Plural-Forms: nplurals=2; plural=(n > 1);\n" #. module: hr_employee_firstname #: model:ir.model,name:hr_employee_firstname.model_hr_employee @@ -21,12 +24,11 @@ msgid "Employee" msgstr "Employé" #. module: hr_employee_firstname -#: field:hr.employee,firstname:0 +#: model:ir.model.fields,field_description:hr_employee_firstname.field_hr_employee_firstname msgid "Firstname" msgstr "Prénom" #. module: hr_employee_firstname -#: field:hr.employee,lastname:0 +#: model:ir.model.fields,field_description:hr_employee_firstname.field_hr_employee_lastname msgid "Lastname" msgstr "Nom" - diff --git a/hr_employee_firstname/i18n/hr.po b/hr_employee_firstname/i18n/hr.po new file mode 100644 index 000000000000..f1e1dfd3e6e0 --- /dev/null +++ b/hr_employee_firstname/i18n/hr.po @@ -0,0 +1,34 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * hr_employee_firstname +# +# Translators: +# Bole , 2017 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-07-04 06:52+0000\n" +"PO-Revision-Date: 2017-07-04 06:52+0000\n" +"Last-Translator: Bole , 2017\n" +"Language-Team: Croatian (https://www.transifex.com/oca/teams/23907/hr/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: hr\n" +"Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n" + +#. module: hr_employee_firstname +#: model:ir.model,name:hr_employee_firstname.model_hr_employee +msgid "Employee" +msgstr "Djelatnik" + +#. module: hr_employee_firstname +#: model:ir.model.fields,field_description:hr_employee_firstname.field_hr_employee_firstname +msgid "Firstname" +msgstr "Ime" + +#. module: hr_employee_firstname +#: model:ir.model.fields,field_description:hr_employee_firstname.field_hr_employee_lastname +msgid "Lastname" +msgstr "Prezime" diff --git a/hr_employee_firstname/i18n/hr_HR.po b/hr_employee_firstname/i18n/hr_HR.po new file mode 100644 index 000000000000..dcd3d20d9940 --- /dev/null +++ b/hr_employee_firstname/i18n/hr_HR.po @@ -0,0 +1,34 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * hr_employee_firstname +# +# Translators: +# Bole , 2017 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-01-28 02:12+0000\n" +"PO-Revision-Date: 2017-01-28 02:12+0000\n" +"Last-Translator: Bole , 2017\n" +"Language-Team: Croatian (Croatia) (https://www.transifex.com/oca/teams/23907/hr_HR/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: hr_HR\n" +"Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n" + +#. module: hr_employee_firstname +#: model:ir.model,name:hr_employee_firstname.model_hr_employee +msgid "Employee" +msgstr "Djelatnik" + +#. module: hr_employee_firstname +#: model:ir.model.fields,field_description:hr_employee_firstname.field_hr_employee_firstname +msgid "Firstname" +msgstr "" + +#. module: hr_employee_firstname +#: model:ir.model.fields,field_description:hr_employee_firstname.field_hr_employee_lastname +msgid "Lastname" +msgstr "" diff --git a/hr_employee_firstname/i18n/hr_employee_firstname.pot b/hr_employee_firstname/i18n/hr_employee_firstname.pot deleted file mode 100644 index 6b13f0cf122c..000000000000 --- a/hr_employee_firstname/i18n/hr_employee_firstname.pot +++ /dev/null @@ -1,32 +0,0 @@ -# Translation of Odoo Server. -# This file contains the translation of the following modules: -# * hr_employee_firstname -# -msgid "" -msgstr "" -"Project-Id-Version: Odoo Server 8.0\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2015-04-24 10:20+0000\n" -"PO-Revision-Date: 2015-04-24 10:20+0000\n" -"Last-Translator: <>\n" -"Language-Team: \n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: \n" -"Plural-Forms: \n" - -#. module: hr_employee_firstname -#: model:ir.model,name:hr_employee_firstname.model_hr_employee -msgid "Employee" -msgstr "" - -#. module: hr_employee_firstname -#: field:hr.employee,firstname:0 -msgid "Firstname" -msgstr "" - -#. module: hr_employee_firstname -#: field:hr.employee,lastname:0 -msgid "Lastname" -msgstr "" - diff --git a/hr_employee_firstname/i18n/it.po b/hr_employee_firstname/i18n/it.po index a24c509f82b9..ad37b473f645 100644 --- a/hr_employee_firstname/i18n/it.po +++ b/hr_employee_firstname/i18n/it.po @@ -3,15 +3,15 @@ # * hr_employee_firstname # # Translators: -# Paolo Valier, 2016 +# OCA Transbot , 2017 msgid "" msgstr "" -"Project-Id-Version: hr (8.0)\n" +"Project-Id-Version: Odoo Server 10.0\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2016-03-12 12:02+0000\n" -"PO-Revision-Date: 2016-03-19 10:38+0000\n" -"Last-Translator: Paolo Valier\n" -"Language-Team: Italian (http://www.transifex.com/oca/OCA-hr-8-0/language/it/)\n" +"POT-Creation-Date: 2017-01-28 02:12+0000\n" +"PO-Revision-Date: 2017-01-28 02:12+0000\n" +"Last-Translator: OCA Transbot , 2017\n" +"Language-Team: Italian (https://www.transifex.com/oca/teams/23907/it/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: \n" @@ -24,11 +24,11 @@ msgid "Employee" msgstr "Dipendente" #. module: hr_employee_firstname -#: field:hr.employee,firstname:0 +#: model:ir.model.fields,field_description:hr_employee_firstname.field_hr_employee_firstname msgid "Firstname" msgstr "Nome" #. module: hr_employee_firstname -#: field:hr.employee,lastname:0 +#: model:ir.model.fields,field_description:hr_employee_firstname.field_hr_employee_lastname msgid "Lastname" msgstr "Cognome" diff --git a/hr_employee_firstname/i18n/nl_NL.po b/hr_employee_firstname/i18n/nl_NL.po index eb09d04a5f4f..881ea6a88e93 100644 --- a/hr_employee_firstname/i18n/nl_NL.po +++ b/hr_employee_firstname/i18n/nl_NL.po @@ -3,15 +3,15 @@ # * hr_employee_firstname # # Translators: -# lfreeke , 2015 +# OCA Transbot , 2017 msgid "" msgstr "" -"Project-Id-Version: hr (8.0)\n" +"Project-Id-Version: Odoo Server 10.0\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2015-10-03 22:37+0000\n" -"PO-Revision-Date: 2015-09-28 20:59+0000\n" -"Last-Translator: lfreeke \n" -"Language-Team: Dutch (Netherlands) (http://www.transifex.com/oca/OCA-hr-8-0/language/nl_NL/)\n" +"POT-Creation-Date: 2017-01-28 02:12+0000\n" +"PO-Revision-Date: 2017-01-28 02:12+0000\n" +"Last-Translator: OCA Transbot , 2017\n" +"Language-Team: Dutch (Netherlands) (https://www.transifex.com/oca/teams/23907/nl_NL/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: \n" @@ -24,11 +24,11 @@ msgid "Employee" msgstr "Werknemer" #. module: hr_employee_firstname -#: field:hr.employee,firstname:0 +#: model:ir.model.fields,field_description:hr_employee_firstname.field_hr_employee_firstname msgid "Firstname" msgstr "Voornaam" #. module: hr_employee_firstname -#: field:hr.employee,lastname:0 +#: model:ir.model.fields,field_description:hr_employee_firstname.field_hr_employee_lastname msgid "Lastname" msgstr "Achternaam" diff --git a/hr_employee_firstname/i18n/pt_BR.po b/hr_employee_firstname/i18n/pt_BR.po index 5c433097e413..d59e8706caa7 100644 --- a/hr_employee_firstname/i18n/pt_BR.po +++ b/hr_employee_firstname/i18n/pt_BR.po @@ -3,15 +3,15 @@ # * hr_employee_firstname # # Translators: -# danimaribeiro , 2016 +# OCA Transbot , 2017 msgid "" msgstr "" -"Project-Id-Version: hr (8.0)\n" +"Project-Id-Version: Odoo Server 10.0\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2016-03-11 01:48+0000\n" -"PO-Revision-Date: 2016-03-08 03:18+0000\n" -"Last-Translator: danimaribeiro \n" -"Language-Team: Portuguese (Brazil) (http://www.transifex.com/oca/OCA-hr-8-0/language/pt_BR/)\n" +"POT-Creation-Date: 2017-01-28 02:12+0000\n" +"PO-Revision-Date: 2017-01-28 02:12+0000\n" +"Last-Translator: OCA Transbot , 2017\n" +"Language-Team: Portuguese (Brazil) (https://www.transifex.com/oca/teams/23907/pt_BR/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: \n" @@ -24,11 +24,11 @@ msgid "Employee" msgstr "Empregado" #. module: hr_employee_firstname -#: field:hr.employee,firstname:0 +#: model:ir.model.fields,field_description:hr_employee_firstname.field_hr_employee_firstname msgid "Firstname" msgstr "Primeiro nome" #. module: hr_employee_firstname -#: field:hr.employee,lastname:0 +#: model:ir.model.fields,field_description:hr_employee_firstname.field_hr_employee_lastname msgid "Lastname" msgstr "Último nome" diff --git a/hr_employee_firstname/i18n/ro.po b/hr_employee_firstname/i18n/ro.po index e8d7be091fc7..c6de161c0c34 100644 --- a/hr_employee_firstname/i18n/ro.po +++ b/hr_employee_firstname/i18n/ro.po @@ -1,19 +1,22 @@ # Translation of Odoo Server. # This file contains the translation of the following modules: -# * hr_employee_firstname -# +# * hr_employee_firstname +# +# Translators: +# OCA Transbot , 2017 msgid "" msgstr "" -"Project-Id-Version: Odoo Server 8.0\n" +"Project-Id-Version: Odoo Server 10.0\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2015-04-24 10:20+0000\n" -"PO-Revision-Date: 2015-04-24 10:20+0000\n" -"Last-Translator: <>\n" -"Language-Team: \n" +"POT-Creation-Date: 2017-01-28 02:12+0000\n" +"PO-Revision-Date: 2017-01-28 02:12+0000\n" +"Last-Translator: OCA Transbot , 2017\n" +"Language-Team: Romanian (https://www.transifex.com/oca/teams/23907/ro/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: \n" -"Plural-Forms: \n" +"Language: ro\n" +"Plural-Forms: nplurals=3; plural=(n==1?0:(((n%100>19)||((n%100==0)&&(n!=0)))?2:1));\n" #. module: hr_employee_firstname #: model:ir.model,name:hr_employee_firstname.model_hr_employee @@ -21,12 +24,11 @@ msgid "Employee" msgstr "Angajat" #. module: hr_employee_firstname -#: field:hr.employee,firstname:0 +#: model:ir.model.fields,field_description:hr_employee_firstname.field_hr_employee_firstname msgid "Firstname" msgstr "Prenume" #. module: hr_employee_firstname -#: field:hr.employee,lastname:0 +#: model:ir.model.fields,field_description:hr_employee_firstname.field_hr_employee_lastname msgid "Lastname" msgstr "Nume" - diff --git a/hr_employee_firstname/i18n/sl.po b/hr_employee_firstname/i18n/sl.po index 122a067c389a..dae9f5530311 100644 --- a/hr_employee_firstname/i18n/sl.po +++ b/hr_employee_firstname/i18n/sl.po @@ -3,15 +3,15 @@ # * hr_employee_firstname # # Translators: -# Matjaž Mozetič , 2015 +# OCA Transbot , 2017 msgid "" msgstr "" -"Project-Id-Version: hr (8.0)\n" +"Project-Id-Version: Odoo Server 10.0\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2015-08-18 13:10+0000\n" -"PO-Revision-Date: 2015-08-16 11:40+0000\n" -"Last-Translator: Matjaž Mozetič \n" -"Language-Team: Slovenian (http://www.transifex.com/oca/OCA-hr-8-0/language/sl/)\n" +"POT-Creation-Date: 2017-01-28 02:12+0000\n" +"PO-Revision-Date: 2017-01-28 02:12+0000\n" +"Last-Translator: OCA Transbot , 2017\n" +"Language-Team: Slovenian (https://www.transifex.com/oca/teams/23907/sl/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: \n" @@ -24,11 +24,11 @@ msgid "Employee" msgstr "Kader" #. module: hr_employee_firstname -#: field:hr.employee,firstname:0 +#: model:ir.model.fields,field_description:hr_employee_firstname.field_hr_employee_firstname msgid "Firstname" msgstr "Ime" #. module: hr_employee_firstname -#: field:hr.employee,lastname:0 +#: model:ir.model.fields,field_description:hr_employee_firstname.field_hr_employee_lastname msgid "Lastname" msgstr "Priimek" diff --git a/hr_employee_firstname/init_hook.py b/hr_employee_firstname/init_hook.py new file mode 100644 index 000000000000..12ca46d33d5d --- /dev/null +++ b/hr_employee_firstname/init_hook.py @@ -0,0 +1,11 @@ +# -*- coding: utf-8 -*- +# Copyright 2016 Onestein () +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + +from odoo import SUPERUSER_ID +from odoo.api import Environment + + +def post_init_hook(cr, pool): + env = Environment(cr, SUPERUSER_ID, {}) + env['hr.employee']._update_employee_names() diff --git a/hr_employee_firstname/models/__init__.py b/hr_employee_firstname/models/__init__.py index c48e9660be46..ea58859484d5 100644 --- a/hr_employee_firstname/models/__init__.py +++ b/hr_employee_firstname/models/__init__.py @@ -1,23 +1,5 @@ # -*- coding: utf-8 -*- -############################################################################## -# -# OpenERP, Open Source Management Solution -# This module copyright (C) 2010 - 2014 Savoir-faire Linux -# (). -# -# 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 . -# -############################################################################## +# © 2010 - 2014 Savoir-faire Linux () +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). from . import hr_employee diff --git a/hr_employee_firstname/models/hr_employee.py b/hr_employee_firstname/models/hr_employee.py index e7022e28c29f..f7617af79267 100644 --- a/hr_employee_firstname/models/hr_employee.py +++ b/hr_employee_firstname/models/hr_employee.py @@ -1,29 +1,10 @@ # -*- coding: utf-8 -*- -############################################################################## -# -# OpenERP, Open Source Management Solution -# This module copyright (C) 2010 - 2014 Savoir-faire Linux -# (). -# -# 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 . -# -############################################################################## +# © 2010 - 2014 Savoir-faire Linux () +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -from openerp import models, fields, api, SUPERUSER_ID +from odoo import models, fields, api -UPDATE_PARTNER_FIELDS = set(['firstname', 'lastname', 'user_id', - 'address_home_id']) +UPDATE_PARTNER_FIELDS = ['firstname', 'lastname', 'user_id', 'address_home_id'] class HrEmployee(models.Model): @@ -34,11 +15,6 @@ def split_name(self, name): clean_name = u" ".join(name.split(None)) if name else name return self.env['res.partner']._get_inverse_name(clean_name) - @api.cr_context - def _auto_init(self, cr, context=None): - super(HrEmployee, self)._auto_init(cr, context=context) - self._update_employee_names(cr, SUPERUSER_ID, context=context) - @api.model def _update_employee_names(self): employees = self.search([ @@ -64,11 +40,13 @@ def _update_partner_firstname(self, employee): def _get_name(self, lastname, firstname): return self.env['res.partner']._get_computed_name(lastname, firstname) - @api.one + @api.multi @api.onchange('firstname', 'lastname') def get_name(self): - if self.firstname and self.lastname: - self.name = self._get_name(self.lastname, self.firstname) + for employee in self: + if employee.firstname and employee.lastname: + employee.name = self._get_name( + employee.lastname, employee.firstname) def _firstname_default(self): return ' ' if self.env.context.get('module') else False diff --git a/hr_employee_firstname/tests/__init__.py b/hr_employee_firstname/tests/__init__.py index a9df4e5c6e2b..f24f5d832fc2 100644 --- a/hr_employee_firstname/tests/__init__.py +++ b/hr_employee_firstname/tests/__init__.py @@ -1 +1,4 @@ +# -*- coding: utf-8 -*- +# Copyright (C) 2014 Savoir-faire Linux. All Rights Reserved. +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). from . import test_hr_employee_firstname diff --git a/hr_employee_firstname/tests/test_hr_employee_firstname.py b/hr_employee_firstname/tests/test_hr_employee_firstname.py index fb49f1042005..2e8a27d1bc1d 100644 --- a/hr_employee_firstname/tests/test_hr_employee_firstname.py +++ b/hr_employee_firstname/tests/test_hr_employee_firstname.py @@ -1,26 +1,9 @@ # -*- coding: utf-8 -*- -############################################################################## -# -# Copyright (C) 2014 Savoir-faire Linux. All Rights Reserved. -# -# 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 . -# -############################################################################## - -import openerp.tests -from openerp.tests.common import TransactionCase +# Copyright (C) 2014 Savoir-faire Linux. All Rights Reserved. +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +import odoo +from odoo.tests.common import TransactionCase class TestEmployeeFirstname(TransactionCase): @@ -60,6 +43,17 @@ def test_get_name(self): # Check for employee3 self.assertEqual(self.employee3_id.name, 'Jenssens Famke') + def test_onchange(self): + """ + Validate the get_name method is not failing + """ + field_onchange = self.employee1_id._onchange_spec() + self.assertEqual(field_onchange.get('firstname'), '1') + self.assertEqual(field_onchange.get('lastname'), '1') + values = {'firstname': 'Antonio', 'lastname': 'Esposito'} + self.employee1_id.onchange(values, 'firstname', field_onchange) + self.employee1_id.onchange(values, 'lastname', field_onchange) + def test_auto_init_name(self): """ Validate the create method if the name is split @@ -111,10 +105,10 @@ def test_change_firstname_and_lastname(self): self.assertEqual(self.employee1_id.name, 'Carnaud Jean-Pierre') - @openerp.tests.common.at_install(False) - @openerp.tests.common.post_install(True) + @odoo.tests.common.at_install(False) + @odoo.tests.common.post_install(True) def test_update_name_post_install(self): - self.empl_demo = self.env.ref('hr.employee_fp') + self.empl_demo = self.env.ref('hr.employee_root') self.assertEqual(self.empl_demo.firstname, 'Parker') self.assertEqual(self.empl_demo.lastname, 'Pieter') diff --git a/hr_employee_firstname/views/hr_view.xml b/hr_employee_firstname/views/hr_view.xml index 16aa496fb0ae..4f053fbbef7c 100644 --- a/hr_employee_firstname/views/hr_view.xml +++ b/hr_employee_firstname/views/hr_view.xml @@ -1,27 +1,28 @@ - - + hr.employee - - - +