← Back to team overview

savoirfairelinux-openerp team mailing list archive

[Merge] lp:~savoirfairelinux-openerp/openerp-hr/hr_employee_firstname into lp:openerp-hr

 

elhadji.dem@xxxxxxxxxxxxxxxxxxxx has proposed merging lp:~savoirfairelinux-openerp/openerp-hr/hr_employee_firstname into lp:openerp-hr.

Requested reviews:
  HR Core Editors (hr-core-editors)

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 Savoir-faire Linux' OpenERP is subscribed to branch lp:~savoirfairelinux-openerp/openerp-hr/hr_employee_firstname.
=== 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-01-30 18:46:14 +0000
@@ -0,0 +1,25 @@
+# -*- encoding: utf-8 -*-
+##############################################################################
+#
+#    OpenERP, Open Source Management Solution
+#    This module copyright (C) 2013 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/>.
+#
+##############################################################################
+
+import hr
+
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

=== 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-01-30 18:46:14 +0000
@@ -0,0 +1,54 @@
+# -*- encoding: utf-8 -*-
+##############################################################################
+#
+#    OpenERP, Open Source Management Solution
+#    This module copyright (C) 2013 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',
+    'category': 'MISC',
+    '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)
+""",
+    'depends': [
+        'hr',
+    ],
+    'external_dependencies': {},
+    'data': [
+        'hr_view.xml',
+    ],
+    'demo': [],
+    'test': [],
+    'installable': True,
+    'active': False,
+}
+
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

=== 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-01-30 18:46:14 +0000
@@ -0,0 +1,42 @@
+# -*- encoding: utf-8 -*-
+##############################################################################
+#
+#    OpenERP, Open Source Management Solution
+#    This module copyright (C) 2013 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')
+    _columns = {
+        'firstname': fields.char("Firstname"),
+        'lastname': fields.char("Lastname", required=True)}
+
+    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)
+
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

=== 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-01-30 18:46:14 +0000
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="utf-8"?>
+<openerp>
+  <data>
+    <record id="hr_employee_view_firstname_form" model="ir.ui.view">
+      <field name="name">hr.employee.view.form.inherit.firstname</field>
+      <field name="model">hr.employee</field>
+      <field name="inherit_id" ref="hr.view_employee_form"/>
+      <field name="arch" type="xml">
+        <field name="name" position="replace">
+          <field name="name" invisible="True" nolabel="1" required="False"/>
+        </field>
+        <field name="name" position="after">
+          <field name="firstname" placeholder="e.g. Firstname"/>
+          <field name="lastname" placeholder="e.g. Lastname"/>
+        </field>
+      </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-01-30 18:46:14 +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-01-30 18:46:14 +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"


Follow ups