Skip to content

Commit

Permalink
[ADD] hr_employee_firstname_partner_firstname.
Browse files Browse the repository at this point in the history
New glue module between hr_employee_firstname and partner_firstname. Correctly prepare employee value, when creating employee from user.
  • Loading branch information
legalsylvain committed Dec 17, 2024
1 parent d174642 commit f79a40f
Show file tree
Hide file tree
Showing 13 changed files with 606 additions and 0 deletions.
88 changes: 88 additions & 0 deletions hr_employee_firstname_partner_firstname/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
=============================================
Partner and HR Employee First Name, Last Name
=============================================

..
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:f3087fb7c0f7ec6999494364a3ed350352f8e4c438cdb600118d065bf6287c46
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
:target: https://odoo-community.org/page/development-status
:alt: Beta
.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fhr-lightgray.png?logo=github
:target: https://github.com/OCA/hr/tree/16.0/hr_employee_firstname_partner_firstname
:alt: OCA/hr
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/hr-16-0/hr-16-0-hr_employee_firstname_partner_firstname
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
:target: https://runboat.odoo-community.org/builds?repo=OCA/hr&target_branch=16.0
:alt: Try me on Runboat

|badge1| |badge2| |badge3| |badge4| |badge5|

This module is glue module to make ``partner_firstname`` and ``hr_employee_firstname``
working together.

* When creating employee from users, recover correctly, prepare lastname and firstname
set on the user level.

**Table of contents**

.. contents::
:local:

Bug Tracker
===========

Bugs are tracked on `GitHub Issues <https://github.com/OCA/hr/issues>`_.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us to smash it by providing a detailed and welcomed
`feedback <https://github.com/OCA/hr/issues/new?body=module:%20hr_employee_firstname_partner_firstname%0Aversion:%2016.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.

Do not contact contributors directly about support or help with technical issues.

Credits
=======

Authors
~~~~~~~

* GRAP

Contributors
~~~~~~~~~~~~

* Sylvain LE GAL

Maintainers
~~~~~~~~~~~

This module is maintained by the OCA.

.. image:: https://odoo-community.org/logo.png
:alt: Odoo Community Association
:target: https://odoo-community.org

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.

.. |maintainer-legalsylvain| image:: https://github.com/legalsylvain.png?size=40px
:target: https://github.com/legalsylvain
:alt: legalsylvain

Current `maintainer <https://odoo-community.org/page/maintainer-role>`__:

|maintainer-legalsylvain|

This module is part of the `OCA/hr <https://github.com/OCA/hr/tree/16.0/hr_employee_firstname_partner_firstname>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
1 change: 1 addition & 0 deletions hr_employee_firstname_partner_firstname/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import models
16 changes: 16 additions & 0 deletions hr_employee_firstname_partner_firstname/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Copyright 2024-Today GRAP (<https://www.grap.coop>)
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

{
"name": "Partner and HR Employee First Name, Last Name",
"version": "16.0.1.0.0",
"author": "GRAP, Odoo Community Association (OCA)",
"maintainers": ["legalsylvain"],
"website": "https://github.com/OCA/hr",
"license": "AGPL-3",
"category": "Human Resources",
"summary": "Glue module between partner_firstname and hr_employee_firstname",
"depends": ["hr_employee_firstname", "partner_firstname"],
"installable": True,
"autoinstall": True,
}
21 changes: 21 additions & 0 deletions hr_employee_firstname_partner_firstname/i18n/fr.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * hr_employee_firstname_partner_firstname
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 16.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-12-17 23:27+0000\n"
"PO-Revision-Date: 2024-12-17 23:27+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_partner_firstname
#: model:ir.model,name:hr_employee_firstname_partner_firstname.model_hr_employee
msgid "Employee"
msgstr "Employé"
1 change: 1 addition & 0 deletions hr_employee_firstname_partner_firstname/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import hr_employee
13 changes: 13 additions & 0 deletions hr_employee_firstname_partner_firstname/models/hr_employee.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Copyright 2024-Today GRAP (<http://www.grap.coop>)
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

from odoo import models


class HrEmployee(models.Model):
_inherit = "hr.employee"

def _sync_user(self, user, employee_has_image=False):
vals = super()._sync_user(user, employee_has_image=employee_has_image)
vals.update({"firstname": user.firstname, "lastname": user.lastname})
return vals
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* Sylvain LE GAL
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
This module is glue module to make ``partner_firstname`` and ``hr_employee_firstname``
working together.

* When creating employee from users, recover correctly, prepare lastname and firstname
set on the user level.
Loading

0 comments on commit f79a40f

Please sign in to comment.