openerp-community-reviewer team mailing list archive
-
openerp-community-reviewer team
-
Mailing list archive
-
Message #07465
[Merge] lp:~savoirfairelinux-openerp/openerp-hr/hr_employee_firstname into lp:openerp-hr
You have been requested to review the proposed merge of lp:~savoirfairelinux-openerp/openerp-hr/hr_employee_firstname into lp:openerp-hr.
For more details, see:
https://code.launchpad.net/~savoirfairelinux-openerp/openerp-hr/hr_employee_firstname/+merge/204065
Add hr_employee_firstname module; it adds the firstname field on employee; name is considered like the last name
--
https://code.launchpad.net/~savoirfairelinux-openerp/openerp-hr/hr_employee_firstname/+merge/204065
Your team OpenERP Community Reviewer/Maintainer is requested to review the proposed merge of lp:~savoirfairelinux-openerp/openerp-hr/hr_employee_firstname into lp:openerp-hr.
=== added directory 'hr_employee_firstname'
=== added file 'hr_employee_firstname/__init__.py'
--- hr_employee_firstname/__init__.py 1970-01-01 00:00:00 +0000
+++ hr_employee_firstname/__init__.py 2014-03-04 16:23:46 +0000
@@ -0,0 +1,23 @@
+# -*- encoding: utf-8 -*-
+##############################################################################
+#
+# OpenERP, Open Source Management Solution
+# This module copyright (C) 2010 - 2014 Savoir-faire Linux
+# (<http://www.savoirfairelinux.com>).
+#
+# 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 <http://www.gnu.org/licenses/>.
+#
+##############################################################################
+
+from . import hr
=== added file 'hr_employee_firstname/__openerp__.py'
--- hr_employee_firstname/__openerp__.py 1970-01-01 00:00:00 +0000
+++ hr_employee_firstname/__openerp__.py 2014-03-04 16:23:46 +0000
@@ -0,0 +1,54 @@
+# -*- encoding: utf-8 -*-
+##############################################################################
+#
+# OpenERP, Open Source Management Solution
+# This module copyright (C) 2010 - 2014 Savoir-faire Linux
+# (<http://www.savoirfairelinux.com>).
+#
+# 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 <http://www.gnu.org/licenses/>.
+#
+##############################################################################
+
+{
+ 'name': 'Employee First Name, Last Name',
+ 'version': '0.1',
+ 'author': 'Savoir-faire Linux',
+ 'maintainer': 'Savoir-faire Linux',
+ 'website': 'http://www.savoirfairelinux.com',
+ 'license': 'AGPL-3',
+ 'category': 'Human Resources',
+ 'summary': 'Adds First Name to Employee',
+ 'description': """
+Employee First Name, Last Name
+==============================
+
+This module allows you to add firstname and lastname in employee form,
+and concatenate both in name field.
+
+Contributors
+------------
+* El Hadji Dem (elhadji.dem@xxxxxxxxxxxxxxxxxxxx)
+* Sandy Carter (sandy.carter@xxxxxxxxxxxxxxxxxxxx)
+""",
+ 'depends': [
+ 'hr',
+ ],
+ 'external_dependencies': {},
+ 'data': [
+ 'hr_view.xml',
+ ],
+ 'demo': [],
+ 'test': [],
+ 'installable': True,
+}
=== added file 'hr_employee_firstname/hr.py'
--- hr_employee_firstname/hr.py 1970-01-01 00:00:00 +0000
+++ hr_employee_firstname/hr.py 2014-03-04 16:23:46 +0000
@@ -0,0 +1,50 @@
+# -*- encoding: utf-8 -*-
+##############################################################################
+#
+# OpenERP, Open Source Management Solution
+# This module copyright (C) 2010 - 2014 Savoir-faire Linux
+# (<http://www.savoirfairelinux.com>).
+#
+# 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 <http://www.gnu.org/licenses/>.
+#
+##############################################################################
+
+from openerp.osv import orm, fields
+
+
+class hr_employee(orm.Model):
+ _inherit = 'hr.employee'
+
+ def init(self, cursor):
+ cursor.execute('''\
+SELECT id
+FROM hr_employee
+WHERE lastname IS NOT NULL
+LIMIT 1''')
+ if not cursor.fetchone():
+ cursor.execute('''\
+UPDATE hr_employee
+SET lastname = name_related
+WHERE name_related IS NOT NULL''')
+
+ def create(self, cursor, uid, vals, context=None):
+ names = (vals['firstname'], vals['lastname'])
+ vals['name'] = " ".join(s for s in names if s)
+ return super(hr_employee, self).create(
+ cursor, uid, vals, context=context)
+
+ _columns = {
+ 'firstname': fields.char("Firstname"),
+ 'lastname': fields.char("Lastname", required=True)
+ }
=== added file 'hr_employee_firstname/hr_view.xml'
--- hr_employee_firstname/hr_view.xml 1970-01-01 00:00:00 +0000
+++ hr_employee_firstname/hr_view.xml 2014-03-04 16:23:46 +0000
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="utf-8"?>
+<openerp>
+ <data>
+
+ <record id="view_employee_form" model="ir.ui.view">
+ <field name="model">hr.employee</field>
+ <field name="inherit_id" ref="hr.view_employee_form"/>
+ <field name="arch" type="xml">
+
+ <label for="name" position="replace">
+ <label for="firstname" class="oe_edit_only"/>
+ </label>
+ <field name="name" position="replace">
+ <field name="name" invisible="True" nolabel="1" required="False"/>
+ <field name="firstname"/>
+ </field>
+
+ <label for="category_ids" position="before">
+ <label for="lastname" class="oe_edit_only"/>
+ <h1>
+ <field name="lastname"/>
+ </h1>
+ </label>
+
+ </field>
+ </record>
+
+ </data>
+</openerp>
=== added directory 'hr_employee_firstname/i18n'
=== added file 'hr_employee_firstname/i18n/employee_firstname.pot'
--- hr_employee_firstname/i18n/employee_firstname.pot 1970-01-01 00:00:00 +0000
+++ hr_employee_firstname/i18n/employee_firstname.pot 2014-03-04 16:23:46 +0000
@@ -0,0 +1,42 @@
+# Translation of OpenERP Server.
+# This file contains the translation of the following modules:
+# * employee_firstname
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: OpenERP Server 7.0\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2014-01-03 07:55+0000\n"
+"PO-Revision-Date: 2014-01-03 02:55-0500\n"
+"Last-Translator: EL Hadji DEM <elhadji.dem@xxxxxxxxxxxxxxxxxxxx>\n"
+"Language-Team: \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Plural-Forms: \n"
+"X-Generator: Poedit 1.5.4\n"
+
+#. module: employee_firstname
+#: model:ir.model,name:employee_firstname.model_hr_employee
+msgid "Employee"
+msgstr ""
+
+#. module: employee_firstname
+#: field:hr.employee,lastname:0
+msgid "Lastname"
+msgstr ""
+
+#. module: employee_firstname
+#: view:hr.employee:0
+msgid "e.g. Lastname"
+msgstr ""
+
+#. module: employee_firstname
+#: field:hr.employee,firstname:0
+msgid "Firstname"
+msgstr ""
+
+#. module: employee_firstname
+#: view:hr.employee:0
+msgid "e.g. Firstname"
+msgstr ""
=== added file 'hr_employee_firstname/i18n/fr.po'
--- hr_employee_firstname/i18n/fr.po 1970-01-01 00:00:00 +0000
+++ hr_employee_firstname/i18n/fr.po 2014-03-04 16:23:46 +0000
@@ -0,0 +1,42 @@
+# Translation of OpenERP Server.
+# This file contains the translation of the following modules:
+# * employee_firstname
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: OpenERP Server 7.0\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2014-01-03 07:56+0000\n"
+"PO-Revision-Date: 2014-01-03 02:56-0500\n"
+"Last-Translator: EL Hadji DEM <elhadji.dem@xxxxxxxxxxxxxxxxxxxx>\n"
+"Language-Team: \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Plural-Forms: \n"
+"X-Generator: Poedit 1.5.4\n"
+
+#. module: employee_firstname
+#: model:ir.model,name:employee_firstname.model_hr_employee
+msgid "Employee"
+msgstr "Employé"
+
+#. module: employee_firstname
+#: field:hr.employee,lastname:0
+msgid "Lastname"
+msgstr "Nom"
+
+#. module: employee_firstname
+#: view:hr.employee:0
+msgid "e.g. Lastname"
+msgstr "Nom"
+
+#. module: employee_firstname
+#: field:hr.employee,firstname:0
+msgid "Firstname"
+msgstr "Prénom"
+
+#. module: employee_firstname
+#: view:hr.employee:0
+msgid "e.g. Firstname"
+msgstr "Prénom"
References